Skip to content

[pull] master from torvalds:master #1972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a833d31
firmware: arm_ffa: Fix memory leak by freeing notifier callback node
sudeep-holla May 28, 2025
27e850c
firmware: arm_ffa: Move memory allocation outside the mutex locking
sudeep-holla May 28, 2025
9ca7a42
firmware: arm_ffa: Replace mutex with rwlock to avoid sleep in atomic…
sudeep-holla May 28, 2025
4c46a47
firmware: arm_ffa: Fix the missing entry in struct ffa_indirect_msg_hdr
vireshk Jun 3, 2025
f17d5b9
arm64: defconfig: update renamed PHY_SNPS_EUSB2
kcxt May 23, 2025
8d2c2fa
firmware: exynos-acpm: fix timeouts on xfers handling
ambarus Jun 6, 2025
312d02a
optee: ffa: fix sleep in atomic context
jenswi-linaro Jun 2, 2025
ac1daa9
arm64: dts: apple: t8103: Fix PCIe BCM4377 nodename
jannau Jun 11, 2025
811a909
arm64: dts: apple: Drop {address,size}-cells from SPI NOR
svenpeter42 Jun 10, 2025
08a0d93
arm64: dts: apple: Move touchbar mipi {address,size}-cells from dtsi …
svenpeter42 Jun 11, 2025
12ffc3b
PM: Restrict swap use to later in the suspend sequence
superm1 Jun 13, 2025
9642092
powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot…
zhang-rui Jun 19, 2025
3e7e5ad
PM: sleep: docs: Replace "diasble" with "disable"
sumanth-gavini May 23, 2025
de1675d
Revert "ACPI: battery: negate current when discharging"
rafaeljw Jul 3, 2025
9a5d769
Merge tag 'ffa-fixes-6.16' of https://git.kernel.org/pub/scm/linux/ke…
arndb Jul 3, 2025
f31824a
Merge tag 'samsung-fixes-6.16' of https://git.kernel.org/pub/scm/linu…
arndb Jul 3, 2025
c6754d7
Merge tag 'optee-fix-for-v6.16' of https://git.kernel.org/pub/scm/lin…
arndb Jul 3, 2025
3f3fb97
Merge tag 'apple-soc-fixes-6.16' of https://git.kernel.org/pub/scm/li…
arndb Jul 3, 2025
b1bf2ef
Merge tag 'soc-fixes-6.16' of git://git.kernel.org/pub/scm/linux/kern…
torvalds Jul 4, 2025
250d057
Merge branch 'pm-sleep'
rafaeljw Jul 4, 2025
49dcc4f
Merge tag 'acpi-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kerne…
torvalds Jul 5, 2025
a79a588
Merge tag 'pm-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/…
torvalds Jul 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Documentation/ABI/testing/sysfs-devices-power
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Date: January 2009
Contact: Rafael J. Wysocki <[email protected]>
Description:
The /sys/devices/.../async attribute allows the user space to
enable or diasble the device's suspend and resume callbacks to
enable or disable the device's suspend and resume callbacks to
be executed asynchronously (ie. in separate threads, in parallel
with the main suspend/resume thread) during system-wide power
transitions (eg. suspend to RAM, hibernation).
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/boot/dts/apple/spi1-nvram.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
compatible = "jedec,spi-nor";
reg = <0x0>;
spi-max-frequency = <25000000>;
#address-cells = <1>;
#size-cells = <1>;

partitions {
compatible = "fixed-partitions";
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t8103-j293.dts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@

&displaydfr_mipi {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

dfr_panel: panel@0 {
compatible = "apple,j293-summit", "apple,summit";
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
*/
&port00 {
bus-range = <1 1>;
wifi0: network@0,0 {
wifi0: wifi@0,0 {
compatible = "pci14e4,4425";
reg = <0x10000 0x0 0x0 0x0 0x0>;
/* To be filled by the loader */
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/boot/dts/apple/t8103.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@
compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
reg = <0x2 0x28600000 0x0 0x100000>;
power-domains = <&ps_mipi_dsi>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";

ports {
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t8112-j493.dts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

&displaydfr_mipi {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

dfr_panel: panel@0 {
compatible = "apple,j493-summit", "apple,summit";
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/boot/dts/apple/t8112.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,6 @@
compatible = "apple,t8112-display-pipe-mipi", "apple,h7-display-pipe-mipi";
reg = <0x2 0x28600000 0x0 0x100000>;
power-domains = <&ps_mipi_dsi>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";

ports {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ CONFIG_RESET_QCOM_AOSS=y
CONFIG_RESET_QCOM_PDC=m
CONFIG_RESET_RZG2L_USBPHY_CTRL=y
CONFIG_RESET_TI_SCI=y
CONFIG_PHY_SNPS_EUSB2=m
CONFIG_PHY_XGENE=y
CONFIG_PHY_CAN_TRANSCEIVER=m
CONFIG_PHY_NXP_PTN3222=m
Expand All @@ -1597,7 +1598,6 @@ CONFIG_PHY_QCOM_EDP=m
CONFIG_PHY_QCOM_PCIE2=m
CONFIG_PHY_QCOM_QMP=m
CONFIG_PHY_QCOM_QUSB2=m
CONFIG_PHY_QCOM_SNPS_EUSB2=m
CONFIG_PHY_QCOM_EUSB2_REPEATER=m
CONFIG_PHY_QCOM_M31_USB=m
CONFIG_PHY_QCOM_USB_HS=m
Expand Down
19 changes: 3 additions & 16 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,10 @@ static int acpi_battery_get_property(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_CURRENT_NOW:
case POWER_SUPPLY_PROP_POWER_NOW:
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN) {
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
ret = -ENODEV;
break;
}

val->intval = battery->rate_now * 1000;
/*
* When discharging, the current should be reported as a
* negative number as per the power supply class interface
* definition.
*/
if (psp == POWER_SUPPLY_PROP_CURRENT_NOW &&
(battery->state & ACPI_BATTERY_STATE_DISCHARGING) &&
acpi_battery_handle_discharging(battery)
== POWER_SUPPLY_STATUS_DISCHARGING)
val->intval = -val->intval;

else
val->intval = battery->rate_now * 1000;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
Expand Down
5 changes: 4 additions & 1 deletion drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,7 @@ void dpm_complete(pm_message_t state)
*/
void dpm_resume_end(pm_message_t state)
{
pm_restore_gfp_mask();
dpm_resume(state);
dpm_complete(state);
}
Expand Down Expand Up @@ -2176,8 +2177,10 @@ int dpm_suspend_start(pm_message_t state)
error = dpm_prepare(state);
if (error)
dpm_save_failed_step(SUSPEND_PREPARE);
else
else {
pm_restrict_gfp_mask();
error = dpm_suspend(state);
}

dpm_show_time(starttime, state, error, "start");
return error;
Expand Down
71 changes: 36 additions & 35 deletions drivers/firmware/arm_ffa/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct ffa_drv_info {
struct work_struct sched_recv_irq_work;
struct xarray partition_info;
DECLARE_HASHTABLE(notifier_hash, ilog2(FFA_MAX_NOTIFICATIONS));
struct mutex notify_lock; /* lock to protect notifier hashtable */
rwlock_t notify_lock; /* lock to protect notifier hashtable */
};

static struct ffa_drv_info *drv_info;
Expand Down Expand Up @@ -1250,13 +1250,12 @@ notifier_hnode_get_by_type(u16 notify_id, enum notify_type type)
return NULL;
}

static int
update_notifier_cb(struct ffa_device *dev, int notify_id, void *cb,
void *cb_data, bool is_registration, bool is_framework)
static int update_notifier_cb(struct ffa_device *dev, int notify_id,
struct notifier_cb_info *cb, bool is_framework)
{
struct notifier_cb_info *cb_info = NULL;
enum notify_type type = ffa_notify_type_get(dev->vm_id);
bool cb_found;
bool cb_found, is_registration = !!cb;

if (is_framework)
cb_info = notifier_hnode_get_by_vmid_uuid(notify_id, dev->vm_id,
Expand All @@ -1270,20 +1269,10 @@ update_notifier_cb(struct ffa_device *dev, int notify_id, void *cb,
return -EINVAL;

if (is_registration) {
cb_info = kzalloc(sizeof(*cb_info), GFP_KERNEL);
if (!cb_info)
return -ENOMEM;

cb_info->dev = dev;
cb_info->cb_data = cb_data;
if (is_framework)
cb_info->fwk_cb = cb;
else
cb_info->cb = cb;

hash_add(drv_info->notifier_hash, &cb_info->hnode, notify_id);
hash_add(drv_info->notifier_hash, &cb->hnode, notify_id);
} else {
hash_del(&cb_info->hnode);
kfree(cb_info);
}

return 0;
Expand All @@ -1300,20 +1289,19 @@ static int __ffa_notify_relinquish(struct ffa_device *dev, int notify_id,
if (notify_id >= FFA_MAX_NOTIFICATIONS)
return -EINVAL;

mutex_lock(&drv_info->notify_lock);
write_lock(&drv_info->notify_lock);

rc = update_notifier_cb(dev, notify_id, NULL, NULL, false,
is_framework);
rc = update_notifier_cb(dev, notify_id, NULL, is_framework);
if (rc) {
pr_err("Could not unregister notification callback\n");
mutex_unlock(&drv_info->notify_lock);
write_unlock(&drv_info->notify_lock);
return rc;
}

if (!is_framework)
rc = ffa_notification_unbind(dev->vm_id, BIT(notify_id));

mutex_unlock(&drv_info->notify_lock);
write_unlock(&drv_info->notify_lock);

return rc;
}
Expand All @@ -1334,35 +1322,48 @@ static int __ffa_notify_request(struct ffa_device *dev, bool is_per_vcpu,
{
int rc;
u32 flags = 0;
struct notifier_cb_info *cb_info = NULL;

if (ffa_notifications_disabled())
return -EOPNOTSUPP;

if (notify_id >= FFA_MAX_NOTIFICATIONS)
return -EINVAL;

mutex_lock(&drv_info->notify_lock);
cb_info = kzalloc(sizeof(*cb_info), GFP_KERNEL);
if (!cb_info)
return -ENOMEM;

cb_info->dev = dev;
cb_info->cb_data = cb_data;
if (is_framework)
cb_info->fwk_cb = cb;
else
cb_info->cb = cb;

write_lock(&drv_info->notify_lock);

if (!is_framework) {
if (is_per_vcpu)
flags = PER_VCPU_NOTIFICATION_FLAG;

rc = ffa_notification_bind(dev->vm_id, BIT(notify_id), flags);
if (rc) {
mutex_unlock(&drv_info->notify_lock);
return rc;
}
if (rc)
goto out_unlock_free;
}

rc = update_notifier_cb(dev, notify_id, cb, cb_data, true,
is_framework);
rc = update_notifier_cb(dev, notify_id, cb_info, is_framework);
if (rc) {
pr_err("Failed to register callback for %d - %d\n",
notify_id, rc);
if (!is_framework)
ffa_notification_unbind(dev->vm_id, BIT(notify_id));
}
mutex_unlock(&drv_info->notify_lock);

out_unlock_free:
write_unlock(&drv_info->notify_lock);
if (rc)
kfree(cb_info);

return rc;
}
Expand Down Expand Up @@ -1406,9 +1407,9 @@ static void handle_notif_callbacks(u64 bitmap, enum notify_type type)
if (!(bitmap & 1))
continue;

mutex_lock(&drv_info->notify_lock);
read_lock(&drv_info->notify_lock);
cb_info = notifier_hnode_get_by_type(notify_id, type);
mutex_unlock(&drv_info->notify_lock);
read_unlock(&drv_info->notify_lock);

if (cb_info && cb_info->cb)
cb_info->cb(notify_id, cb_info->cb_data);
Expand Down Expand Up @@ -1446,9 +1447,9 @@ static void handle_fwk_notif_callbacks(u32 bitmap)

ffa_rx_release();

mutex_lock(&drv_info->notify_lock);
read_lock(&drv_info->notify_lock);
cb_info = notifier_hnode_get_by_vmid_uuid(notify_id, target, &uuid);
mutex_unlock(&drv_info->notify_lock);
read_unlock(&drv_info->notify_lock);

if (cb_info && cb_info->fwk_cb)
cb_info->fwk_cb(notify_id, cb_info->cb_data, buf);
Expand Down Expand Up @@ -1973,7 +1974,7 @@ static void ffa_notifications_setup(void)
goto cleanup;

hash_init(drv_info->notifier_hash);
mutex_init(&drv_info->notify_lock);
rwlock_init(&drv_info->notify_lock);

drv_info->notif_enabled = true;
return;
Expand Down
25 changes: 9 additions & 16 deletions drivers/firmware/samsung/exynos-acpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ int acpm_do_xfer(const struct acpm_handle *handle, const struct acpm_xfer *xfer)
return -EOPNOTSUPP;
}

msg.chan_id = xfer->acpm_chan_id;
msg.chan_type = EXYNOS_MBOX_CHAN_TYPE_DOORBELL;

scoped_guard(mutex, &achan->tx_lock) {
tx_front = readl(achan->tx.front);
idx = (tx_front + 1) % achan->qlen;
Expand All @@ -446,25 +449,15 @@ int acpm_do_xfer(const struct acpm_handle *handle, const struct acpm_xfer *xfer)

/* Advance TX front. */
writel(idx, achan->tx.front);
}

msg.chan_id = xfer->acpm_chan_id;
msg.chan_type = EXYNOS_MBOX_CHAN_TYPE_DOORBELL;
ret = mbox_send_message(achan->chan, (void *)&msg);
if (ret < 0)
return ret;

ret = acpm_wait_for_message_response(achan, xfer);
ret = mbox_send_message(achan->chan, (void *)&msg);
if (ret < 0)
return ret;

/*
* NOTE: we might prefer not to need the mailbox ticker to manage the
* transfer queueing since the protocol layer queues things by itself.
* Unfortunately, we have to kick the mailbox framework after we have
* received our message.
*/
mbox_client_txdone(achan->chan, ret);
mbox_client_txdone(achan->chan, 0);
}

return ret;
return acpm_wait_for_message_response(achan, xfer);
}

/**
Expand Down
18 changes: 17 additions & 1 deletion drivers/powercap/intel_rapl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,28 @@ static int set_domain_enable(struct powercap_zone *power_zone, bool mode)
{
struct rapl_domain *rd = power_zone_to_rapl_domain(power_zone);
struct rapl_defaults *defaults = get_defaults(rd->rp);
u64 val;
int ret;

cpus_read_lock();
ret = rapl_write_pl_data(rd, POWER_LIMIT1, PL_ENABLE, mode);
if (!ret && defaults->set_floor_freq)
if (ret)
goto end;

ret = rapl_read_pl_data(rd, POWER_LIMIT1, PL_ENABLE, false, &val);
if (ret)
goto end;

if (mode != val) {
pr_debug("%s cannot be %s\n", power_zone->name,
str_enabled_disabled(mode));
goto end;
}

if (defaults->set_floor_freq)
defaults->set_floor_freq(rd, mode);

end:
cpus_read_unlock();

return ret;
Expand Down
Loading