Skip to content

Commit a5e0a4b

Browse files
committed
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
2 parents 7de25c8 + 5b44abb commit a5e0a4b

File tree

6 files changed

+94
-18
lines changed

6 files changed

+94
-18
lines changed

drivers/platform/mellanox/mlxbf-tmfifo.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
struct mlxbf_tmfifo;
5454

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

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

140141
/**
141-
* mlxbf_tmfifo_irq_info - Structure of the interrupt information
142+
* struct mlxbf_tmfifo_irq_info - Structure of the interrupt information
142143
* @fifo: pointer to the tmfifo structure
143144
* @irq: interrupt number
144145
* @index: index into the interrupt array
@@ -150,7 +151,7 @@ struct mlxbf_tmfifo_irq_info {
150151
};
151152

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

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

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

drivers/platform/x86/hp/hp-bioscfg/bioscfg.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
659659
const char *guid, int min_elements,
660660
int instance_id)
661661
{
662-
struct kobject *attr_name_kobj;
662+
struct kobject *attr_name_kobj, *duplicate;
663663
union acpi_object *elements;
664664
struct kset *temp_kset;
665665

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

706706
/* All duplicate attributes found are ignored */
707-
if (kset_find_obj(temp_kset, str_value)) {
707+
duplicate = kset_find_obj(temp_kset, str_value);
708+
if (duplicate) {
708709
pr_debug("Duplicate attribute name found - %s\n", str_value);
710+
/* kset_find_obj() returns a reference */
711+
kobject_put(duplicate);
709712
goto pack_attr_exit;
710713
}
711714

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

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

796799
/* All duplicate attributes found are ignored */
797-
if (kset_find_obj(temp_kset, str)) {
800+
duplicate = kset_find_obj(temp_kset, str);
801+
if (duplicate) {
798802
pr_debug("Duplicate attribute name found - %s\n", str);
803+
/* kset_find_obj() returns a reference */
804+
kobject_put(duplicate);
799805
goto buff_attr_exit;
800806
}
801807

drivers/platform/x86/hp/hp-wmi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,13 @@ static const struct dev_pm_ops hp_wmi_pm_ops = {
15481548
.restore = hp_wmi_resume_handler,
15491549
};
15501550

1551-
static struct platform_driver hp_wmi_driver = {
1551+
/*
1552+
* hp_wmi_bios_remove() lives in .exit.text. For drivers registered via
1553+
* module_platform_driver_probe() this is ok because they cannot get unbound at
1554+
* runtime. So mark the driver struct with __refdata to prevent modpost
1555+
* triggering a section mismatch warning.
1556+
*/
1557+
static struct platform_driver hp_wmi_driver __refdata = {
15521558
.driver = {
15531559
.name = "hp-wmi",
15541560
.pm = &hp_wmi_pm_ops,

drivers/platform/x86/intel/ifs/runtest.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,15 @@ int do_core_test(int cpu, struct device *dev)
331331
switch (test->test_num) {
332332
case IFS_TYPE_SAF:
333333
if (!ifsd->loaded)
334-
return -EPERM;
335-
ifs_test_core(cpu, dev);
334+
ret = -EPERM;
335+
else
336+
ifs_test_core(cpu, dev);
336337
break;
337338
case IFS_TYPE_ARRAY_BIST:
338339
ifs_array_test_core(cpu, dev);
339340
break;
340341
default:
341-
return -EINVAL;
342+
ret = -EINVAL;
342343
}
343344
out:
344345
cpus_read_unlock();

drivers/platform/x86/think-lmi.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,24 @@ static void tlmi_release_attr(void)
12481248
kset_unregister(tlmi_priv.authentication_kset);
12491249
}
12501250

1251+
static int tlmi_validate_setting_name(struct kset *attribute_kset, char *name)
1252+
{
1253+
struct kobject *duplicate;
1254+
1255+
if (!strcmp(name, "Reserved"))
1256+
return -EINVAL;
1257+
1258+
duplicate = kset_find_obj(attribute_kset, name);
1259+
if (duplicate) {
1260+
pr_debug("Duplicate attribute name found - %s\n", name);
1261+
/* kset_find_obj() returns a reference */
1262+
kobject_put(duplicate);
1263+
return -EBUSY;
1264+
}
1265+
1266+
return 0;
1267+
}
1268+
12511269
static int tlmi_sysfs_init(void)
12521270
{
12531271
int i, ret;
@@ -1276,10 +1294,8 @@ static int tlmi_sysfs_init(void)
12761294
continue;
12771295

12781296
/* check for duplicate or reserved values */
1279-
if (kset_find_obj(tlmi_priv.attribute_kset, tlmi_priv.setting[i]->display_name) ||
1280-
!strcmp(tlmi_priv.setting[i]->display_name, "Reserved")) {
1281-
pr_debug("duplicate or reserved attribute name found - %s\n",
1282-
tlmi_priv.setting[i]->display_name);
1297+
if (tlmi_validate_setting_name(tlmi_priv.attribute_kset,
1298+
tlmi_priv.setting[i]->display_name) < 0) {
12831299
kfree(tlmi_priv.setting[i]->possible_values);
12841300
kfree(tlmi_priv.setting[i]);
12851301
tlmi_priv.setting[i] = NULL;

drivers/platform/x86/touchscreen_dmi.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ static const struct ts_dmi_data archos_101_cesium_educ_data = {
4242
.properties = archos_101_cesium_educ_props,
4343
};
4444

45+
static const struct property_entry bush_bush_windows_tablet_props[] = {
46+
PROPERTY_ENTRY_U32("touchscreen-size-x", 1850),
47+
PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
48+
PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
49+
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
50+
PROPERTY_ENTRY_BOOL("silead,home-button"),
51+
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-bush-bush-windows-tablet.fw"),
52+
{ }
53+
};
54+
55+
static const struct ts_dmi_data bush_bush_windows_tablet_data = {
56+
.acpi_name = "MSSL1680:00",
57+
.properties = bush_bush_windows_tablet_props,
58+
};
59+
4560
static const struct property_entry chuwi_hi8_props[] = {
4661
PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
4762
PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
@@ -756,6 +771,21 @@ static const struct ts_dmi_data pipo_w11_data = {
756771
.properties = pipo_w11_props,
757772
};
758773

774+
static const struct property_entry positivo_c4128b_props[] = {
775+
PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
776+
PROPERTY_ENTRY_U32("touchscreen-min-y", 13),
777+
PROPERTY_ENTRY_U32("touchscreen-size-x", 1915),
778+
PROPERTY_ENTRY_U32("touchscreen-size-y", 1269),
779+
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-positivo-c4128b.fw"),
780+
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
781+
{ }
782+
};
783+
784+
static const struct ts_dmi_data positivo_c4128b_data = {
785+
.acpi_name = "MSSL1680:00",
786+
.properties = positivo_c4128b_props,
787+
};
788+
759789
static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
760790
PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
761791
PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
@@ -1070,6 +1100,13 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
10701100
DMI_MATCH(DMI_PRODUCT_NAME, "ARCHOS 101 Cesium Educ"),
10711101
},
10721102
},
1103+
{
1104+
/* Bush Windows tablet */
1105+
.driver_data = (void *)&bush_bush_windows_tablet_data,
1106+
.matches = {
1107+
DMI_MATCH(DMI_PRODUCT_NAME, "Bush Windows tablet"),
1108+
},
1109+
},
10731110
{
10741111
/* Chuwi Hi8 */
10751112
.driver_data = (void *)&chuwi_hi8_data,
@@ -1480,6 +1517,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
14801517
DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
14811518
},
14821519
},
1520+
{
1521+
/* Positivo C4128B */
1522+
.driver_data = (void *)&positivo_c4128b_data,
1523+
.matches = {
1524+
DMI_MATCH(DMI_SYS_VENDOR, "Positivo Tecnologia SA"),
1525+
DMI_MATCH(DMI_PRODUCT_NAME, "C4128B-1"),
1526+
},
1527+
},
14831528
{
14841529
/* Point of View mobii wintab p800w (v2.0) */
14851530
.driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,

0 commit comments

Comments
 (0)