Commit bee74dcb authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpi-fan', 'acpi-pcc', 'acpi-misc' and 'pnp'

Merge ACPI fan driver fixes, ACPI PCC driver fixes, miscellaneous ACPI
cleanups and PNP updates for 6.2-rc1:

 - Make the ACPI fan driver use sysfs_emit_at() in its sysfs interface
   code (ye xingchen).

 - Fix the _FIF package extraction failure handling in the ACPI fan
   driver (Hanjun Guo).

 - Fix the PCC mailbox handling error code path (Huisong Li).

 - Avoid using PCC Opregions if there is no platform interrupt allocated
   for this purpose (Huisong Li).

 - Use sysfs_emit() instead of scnprintf() in the ACPI PAD driver and
   CPPC library (ye xingchen).

 - Fix some kernel-doc issues in the ACPI GSI processing code (Xiongfeng
   Wang).

 - Fix name memory leak in pnp_alloc_dev() (Yang Yingliang).

 - Do not disable PNP devices on suspend when they cannot be re-enabled
   on resume (Hans de Goede).

* acpi-fan:
  ACPI: fan: Convert to use sysfs_emit_at() API
  ACPI: fan: Bail out if extract package failed

* acpi-pcc:
  mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure
  ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available

* acpi-misc:
  ACPI: use sysfs_emit() instead of scnprintf()
  ACPI: irq: Fix some kernel-doc issues

* pnp:
  PNP: Do not disable devices on suspend when they cannot be re-enabled on resume
  PNP: fix name memory leak in pnp_alloc_dev()
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ static ssize_t rrtime_store(struct device *dev,
static ssize_t rrtime_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	return scnprintf(buf, PAGE_SIZE, "%d\n", round_robin_time);
	return sysfs_emit(buf, "%d\n", round_robin_time);
}
static DEVICE_ATTR_RW(rrtime);

@@ -309,7 +309,7 @@ static ssize_t idlepct_store(struct device *dev,
static ssize_t idlepct_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	return scnprintf(buf, PAGE_SIZE, "%d\n", idle_pct);
	return sysfs_emit(buf, "%d\n", idle_pct);
}
static DEVICE_ATTR_RW(idlepct);

+29 −18
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
	struct pcc_data *data;
	struct acpi_pcc_info *ctx = handler_context;
	struct pcc_mbox_chan *pcc_chan;
	static acpi_status ret;

	data = kzalloc(sizeof(*data), GFP_KERNEL);
	if (!data)
@@ -69,23 +70,35 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
	if (IS_ERR(data->pcc_chan)) {
		pr_err("Failed to find PCC channel for subspace %d\n",
		       ctx->subspace_id);
		kfree(data);
		return AE_NOT_FOUND;
		ret = AE_NOT_FOUND;
		goto err_free_data;
	}

	pcc_chan = data->pcc_chan;
	if (!pcc_chan->mchan->mbox->txdone_irq) {
		pr_err("This channel-%d does not support interrupt.\n",
		       ctx->subspace_id);
		ret = AE_SUPPORT;
		goto err_free_channel;
	}
	data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr,
					      pcc_chan->shmem_size);
	if (!data->pcc_comm_addr) {
		pr_err("Failed to ioremap PCC comm region mem for %d\n",
		       ctx->subspace_id);
		pcc_mbox_free_channel(data->pcc_chan);
		kfree(data);
		return AE_NO_MEMORY;
		ret = AE_NO_MEMORY;
		goto err_free_channel;
	}

	*region_context = data;
	return AE_OK;

err_free_channel:
	pcc_mbox_free_channel(data->pcc_chan);
err_free_data:
	kfree(data);

	return ret;
}

static acpi_status
@@ -106,7 +119,6 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
	if (ret < 0)
		return AE_ERROR;

	if (data->pcc_chan->mchan->mbox->txdone_irq) {
	/*
	 * pcc_chan->latency is just a Nominal value. In reality the remote
	 * processor could be much slower to reply. So add an arbitrary
@@ -119,7 +131,6 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
		pr_err("PCC command executed timeout!\n");
		return AE_TIME;
	}
	}

	mbox_chan_txdone(data->pcc_chan->mchan, ret);

+2 −2
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ __ATTR(_name, 0444, show_##_name, NULL)
		if (ret)						\
			return ret;					\
									\
		return scnprintf(buf, PAGE_SIZE, "%llu\n",		\
		return sysfs_emit(buf, "%llu\n",		\
				(u64)st_name.member_name);		\
	}								\
	define_one_cppc_ro(member_name)
@@ -174,7 +174,7 @@ static ssize_t show_feedback_ctrs(struct kobject *kobj,
	if (ret)
		return ret;

	return scnprintf(buf, PAGE_SIZE, "ref:%llu del:%llu\n",
	return sysfs_emit(buf, "ref:%llu del:%llu\n",
			fb_ctrs.reference, fb_ctrs.delivered);
}
define_one_cppc_ro(feedback_ctrs);
+8 −8
Original line number Diff line number Diff line
@@ -27,24 +27,24 @@ static ssize_t show_state(struct device *dev, struct device_attribute *attr, cha
		count = scnprintf(buf, PAGE_SIZE, "%lld:", fps->control);

	if (fps->trip_point == 0xFFFFFFFF || fps->trip_point > 9)
		count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined:");
		count += sysfs_emit_at(buf, count, "not-defined:");
	else
		count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld:", fps->trip_point);
		count += sysfs_emit_at(buf, count, "%lld:", fps->trip_point);

	if (fps->speed == 0xFFFFFFFF)
		count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined:");
		count += sysfs_emit_at(buf, count, "not-defined:");
	else
		count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld:", fps->speed);
		count += sysfs_emit_at(buf, count, "%lld:", fps->speed);

	if (fps->noise_level == 0xFFFFFFFF)
		count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined:");
		count += sysfs_emit_at(buf, count, "not-defined:");
	else
		count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld:", fps->noise_level * 100);
		count += sysfs_emit_at(buf, count, "%lld:", fps->noise_level * 100);

	if (fps->power == 0xFFFFFFFF)
		count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined\n");
		count += sysfs_emit_at(buf, count, "not-defined\n");
	else
		count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld\n", fps->power);
		count += sysfs_emit_at(buf, count, "%lld\n", fps->power);

	return count;
}
+1 −0
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ static int acpi_fan_get_fif(struct acpi_device *device)
	if (ACPI_FAILURE(status)) {
		dev_err(&device->dev, "Invalid _FIF element\n");
		status = -EINVAL;
		goto err;
	}

	fan->fif.revision = fields[0];
Loading