Commit a5e0a4b1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v6.6-4' of...

Merge tag 'platform-drivers-x86-v6.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:
 "Bug fixes, build warning fixes and DMI quirk additions"

* tag 'platform-drivers-x86-v6.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent section mismatch warning
  platform/x86: touchscreen_dmi: Add info for the Positivo C4128B
  platform/x86: touchscreen_dmi: Add info for the BUSH Bush Windows tablet
  platform/mellanox: tmfifo: fix kernel-doc warnings
  platform/x86/intel/ifs: release cpus_read_lock()
  platform/x86: hp-bioscfg: Fix reference leak
  platform/x86: think-lmi: Fix reference leak
parents 7de25c85 5b44abbc
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
struct mlxbf_tmfifo;

/**
 * mlxbf_tmfifo_vring - Structure of the TmFifo virtual ring
 * struct mlxbf_tmfifo_vring - Structure of the TmFifo virtual ring
 * @va: virtual address of the ring
 * @dma: dma address of the ring
 * @vq: pointer to the virtio virtqueue
@@ -113,12 +113,13 @@ enum {
};

/**
 * mlxbf_tmfifo_vdev - Structure of the TmFifo virtual device
 * struct mlxbf_tmfifo_vdev - Structure of the TmFifo virtual device
 * @vdev: virtio device, in which the vdev.id.device field has the
 *        VIRTIO_ID_xxx id to distinguish the virtual device.
 * @status: status of the device
 * @features: supported features of the device
 * @vrings: array of tmfifo vrings of this device
 * @config: non-anonymous union for cons and net
 * @config.cons: virtual console config -
 *               select if vdev.id.device is VIRTIO_ID_CONSOLE
 * @config.net: virtual network config -
@@ -138,7 +139,7 @@ struct mlxbf_tmfifo_vdev {
};

/**
 * mlxbf_tmfifo_irq_info - Structure of the interrupt information
 * struct mlxbf_tmfifo_irq_info - Structure of the interrupt information
 * @fifo: pointer to the tmfifo structure
 * @irq: interrupt number
 * @index: index into the interrupt array
@@ -150,7 +151,7 @@ struct mlxbf_tmfifo_irq_info {
};

/**
 * mlxbf_tmfifo_io - Structure of the TmFifo IO resource (for both rx & tx)
 * struct mlxbf_tmfifo_io - Structure of the TmFifo IO resource (for both rx & tx)
 * @ctl: control register offset (TMFIFO_RX_CTL / TMFIFO_TX_CTL)
 * @sts: status register offset (TMFIFO_RX_STS / TMFIFO_TX_STS)
 * @data: data register offset (TMFIFO_RX_DATA / TMFIFO_TX_DATA)
@@ -162,7 +163,7 @@ struct mlxbf_tmfifo_io {
};

/**
 * mlxbf_tmfifo - Structure of the TmFifo
 * struct mlxbf_tmfifo - Structure of the TmFifo
 * @vdev: array of the virtual devices running over the TmFifo
 * @lock: lock to protect the TmFifo access
 * @res0: mapped resource block 0
@@ -198,7 +199,7 @@ struct mlxbf_tmfifo {
};

/**
 * mlxbf_tmfifo_msg_hdr - Structure of the TmFifo message header
 * struct mlxbf_tmfifo_msg_hdr - Structure of the TmFifo message header
 * @type: message type
 * @len: payload length in network byte order. Messages sent into the FIFO
 *       will be read by the other side as data stream in the same byte order.
@@ -208,6 +209,7 @@ struct mlxbf_tmfifo {
struct mlxbf_tmfifo_msg_hdr {
	u8 type;
	__be16 len;
	/* private: */
	u8 unused[5];
} __packed __aligned(sizeof(u64));

+10 −4
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
					  const char *guid, int min_elements,
					  int instance_id)
{
	struct kobject *attr_name_kobj;
	struct kobject *attr_name_kobj, *duplicate;
	union acpi_object *elements;
	struct kset *temp_kset;

@@ -704,8 +704,11 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
	}

	/* All duplicate attributes found are ignored */
	if (kset_find_obj(temp_kset, str_value)) {
	duplicate = kset_find_obj(temp_kset, str_value);
	if (duplicate) {
		pr_debug("Duplicate attribute name found - %s\n", str_value);
		/* kset_find_obj() returns a reference */
		kobject_put(duplicate);
		goto pack_attr_exit;
	}

@@ -768,7 +771,7 @@ static int hp_init_bios_buffer_attribute(enum hp_wmi_data_type attr_type,
					 const char *guid, int min_elements,
					 int instance_id)
{
	struct kobject *attr_name_kobj;
	struct kobject *attr_name_kobj, *duplicate;
	struct kset *temp_kset;
	char str[MAX_BUFF_SIZE];

@@ -794,8 +797,11 @@ static int hp_init_bios_buffer_attribute(enum hp_wmi_data_type attr_type,
		temp_kset = bioscfg_drv.main_dir_kset;

	/* All duplicate attributes found are ignored */
	if (kset_find_obj(temp_kset, str)) {
	duplicate = kset_find_obj(temp_kset, str);
	if (duplicate) {
		pr_debug("Duplicate attribute name found - %s\n", str);
		/* kset_find_obj() returns a reference */
		kobject_put(duplicate);
		goto buff_attr_exit;
	}

+7 −1
Original line number Diff line number Diff line
@@ -1548,7 +1548,13 @@ static const struct dev_pm_ops hp_wmi_pm_ops = {
	.restore  = hp_wmi_resume_handler,
};

static struct platform_driver hp_wmi_driver = {
/*
 * hp_wmi_bios_remove() lives in .exit.text. For drivers registered via
 * module_platform_driver_probe() this is ok because they cannot get unbound at
 * runtime. So mark the driver struct with __refdata to prevent modpost
 * triggering a section mismatch warning.
 */
static struct platform_driver hp_wmi_driver __refdata = {
	.driver = {
		.name = "hp-wmi",
		.pm = &hp_wmi_pm_ops,
+4 −3
Original line number Diff line number Diff line
@@ -331,14 +331,15 @@ int do_core_test(int cpu, struct device *dev)
	switch (test->test_num) {
	case IFS_TYPE_SAF:
		if (!ifsd->loaded)
			return -EPERM;
			ret = -EPERM;
		else
			ifs_test_core(cpu, dev);
		break;
	case IFS_TYPE_ARRAY_BIST:
		ifs_array_test_core(cpu, dev);
		break;
	default:
		return -EINVAL;
		ret = -EINVAL;
	}
out:
	cpus_read_unlock();
+20 −4
Original line number Diff line number Diff line
@@ -1248,6 +1248,24 @@ static void tlmi_release_attr(void)
	kset_unregister(tlmi_priv.authentication_kset);
}

static int tlmi_validate_setting_name(struct kset *attribute_kset, char *name)
{
	struct kobject *duplicate;

	if (!strcmp(name, "Reserved"))
		return -EINVAL;

	duplicate = kset_find_obj(attribute_kset, name);
	if (duplicate) {
		pr_debug("Duplicate attribute name found - %s\n", name);
		/* kset_find_obj() returns a reference */
		kobject_put(duplicate);
		return -EBUSY;
	}

	return 0;
}

static int tlmi_sysfs_init(void)
{
	int i, ret;
@@ -1276,10 +1294,8 @@ static int tlmi_sysfs_init(void)
			continue;

		/* check for duplicate or reserved values */
		if (kset_find_obj(tlmi_priv.attribute_kset, tlmi_priv.setting[i]->display_name) ||
		    !strcmp(tlmi_priv.setting[i]->display_name, "Reserved")) {
			pr_debug("duplicate or reserved attribute name found - %s\n",
				tlmi_priv.setting[i]->display_name);
		if (tlmi_validate_setting_name(tlmi_priv.attribute_kset,
					       tlmi_priv.setting[i]->display_name) < 0) {
			kfree(tlmi_priv.setting[i]->possible_values);
			kfree(tlmi_priv.setting[i]);
			tlmi_priv.setting[i] = NULL;
Loading