Skip to content

Commit 3e543a4

Browse files
committed
Merge tag 'char-misc-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc into master
Pull char/misc fixes from Greg KH: "Here are number of small char/misc driver fixes for 5.8-rc6 Not that many complex fixes here, just a number of small fixes for reported issues, and some new device ids. Nothing fancy. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) virtio: virtio_console: add missing MODULE_DEVICE_TABLE() for rproc serial intel_th: Fix a NULL dereference when hub driver is not loaded intel_th: pci: Add Emmitsburg PCH support intel_th: pci: Add Tiger Lake PCH-H support intel_th: pci: Add Jasper Lake CPU support virt: vbox: Fix guest capabilities mask check virt: vbox: Fix VBGL_IOCTL_VMMDEV_REQUEST_BIG and _LOG req numbers to match upstream uio_pdrv_genirq: fix use without device tree and no interrupt uio_pdrv_genirq: Remove warning when irq is not specified coresight: etmv4: Fix CPU power management setup in probe() function coresight: cti: Fix error handling in probe Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" mei: bus: don't clean driver pointer misc: atmel-ssc: lock with mutex instead of spinlock phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked phy: rockchip: Fix return value of inno_dsidphy_probe() phy: ti: j721e-wiz: Constify structs phy: ti: am654-serdes: Constify regmap_config phy: intel: fix enum type mismatch warning phy: intel: Fix compilation error on FIELD_PREP usage ...
2 parents 50ad1c2 + 897c44f commit 3e543a4

File tree

21 files changed

+207
-118
lines changed

21 files changed

+207
-118
lines changed

drivers/block/zram/zram_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ static ssize_t hot_add_show(struct class *class,
20212021
return ret;
20222022
return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
20232023
}
2024-
static CLASS_ATTR_RO(hot_add);
2024+
static struct class_attribute class_attr_hot_add =
2025+
__ATTR(hot_add, 0400, hot_add_show, NULL);
20252026

20262027
static ssize_t hot_remove_store(struct class *class,
20272028
struct class_attribute *attr,

drivers/char/virtio_console.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,7 @@ static struct virtio_device_id id_table[] = {
21162116
{ VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID },
21172117
{ 0 },
21182118
};
2119+
MODULE_DEVICE_TABLE(virtio, id_table);
21192120

21202121
static unsigned int features[] = {
21212122
VIRTIO_CONSOLE_F_SIZE,
@@ -2128,6 +2129,7 @@ static struct virtio_device_id rproc_serial_id_table[] = {
21282129
#endif
21292130
{ 0 },
21302131
};
2132+
MODULE_DEVICE_TABLE(virtio, rproc_serial_id_table);
21312133

21322134
static unsigned int rproc_serial_features[] = {
21332135
};
@@ -2280,6 +2282,5 @@ static void __exit fini(void)
22802282
module_init(init);
22812283
module_exit(fini);
22822284

2283-
MODULE_DEVICE_TABLE(virtio, id_table);
22842285
MODULE_DESCRIPTION("Virtio console driver");
22852286
MODULE_LICENSE("GPL");

drivers/hwtracing/coresight/coresight-cti.c

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -747,17 +747,50 @@ static int cti_dying_cpu(unsigned int cpu)
747747
return 0;
748748
}
749749

750+
static int cti_pm_setup(struct cti_drvdata *drvdata)
751+
{
752+
int ret;
753+
754+
if (drvdata->ctidev.cpu == -1)
755+
return 0;
756+
757+
if (nr_cti_cpu)
758+
goto done;
759+
760+
cpus_read_lock();
761+
ret = cpuhp_setup_state_nocalls_cpuslocked(
762+
CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
763+
"arm/coresight_cti:starting",
764+
cti_starting_cpu, cti_dying_cpu);
765+
if (ret) {
766+
cpus_read_unlock();
767+
return ret;
768+
}
769+
770+
ret = cpu_pm_register_notifier(&cti_cpu_pm_nb);
771+
cpus_read_unlock();
772+
if (ret) {
773+
cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
774+
return ret;
775+
}
776+
777+
done:
778+
nr_cti_cpu++;
779+
cti_cpu_drvdata[drvdata->ctidev.cpu] = drvdata;
780+
781+
return 0;
782+
}
783+
750784
/* release PM registrations */
751785
static void cti_pm_release(struct cti_drvdata *drvdata)
752786
{
753-
if (drvdata->ctidev.cpu >= 0) {
754-
if (--nr_cti_cpu == 0) {
755-
cpu_pm_unregister_notifier(&cti_cpu_pm_nb);
787+
if (drvdata->ctidev.cpu == -1)
788+
return;
756789

757-
cpuhp_remove_state_nocalls(
758-
CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
759-
}
760-
cti_cpu_drvdata[drvdata->ctidev.cpu] = NULL;
790+
cti_cpu_drvdata[drvdata->ctidev.cpu] = NULL;
791+
if (--nr_cti_cpu == 0) {
792+
cpu_pm_unregister_notifier(&cti_cpu_pm_nb);
793+
cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
761794
}
762795
}
763796

@@ -823,19 +856,14 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
823856

824857
/* driver data*/
825858
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
826-
if (!drvdata) {
827-
ret = -ENOMEM;
828-
dev_info(dev, "%s, mem err\n", __func__);
829-
goto err_out;
830-
}
859+
if (!drvdata)
860+
return -ENOMEM;
831861

832862
/* Validity for the resource is already checked by the AMBA core */
833863
base = devm_ioremap_resource(dev, res);
834-
if (IS_ERR(base)) {
835-
ret = PTR_ERR(base);
836-
dev_err(dev, "%s, remap err\n", __func__);
837-
goto err_out;
838-
}
864+
if (IS_ERR(base))
865+
return PTR_ERR(base);
866+
839867
drvdata->base = base;
840868

841869
dev_set_drvdata(dev, drvdata);
@@ -854,8 +882,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
854882
pdata = coresight_cti_get_platform_data(dev);
855883
if (IS_ERR(pdata)) {
856884
dev_err(dev, "coresight_cti_get_platform_data err\n");
857-
ret = PTR_ERR(pdata);
858-
goto err_out;
885+
return PTR_ERR(pdata);
859886
}
860887

861888
/* default to powered - could change on PM notifications */
@@ -867,35 +894,20 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
867894
drvdata->ctidev.cpu);
868895
else
869896
cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev);
870-
if (!cti_desc.name) {
871-
ret = -ENOMEM;
872-
goto err_out;
873-
}
897+
if (!cti_desc.name)
898+
return -ENOMEM;
874899

875900
/* setup CPU power management handling for CPU bound CTI devices. */
876-
if (drvdata->ctidev.cpu >= 0) {
877-
cti_cpu_drvdata[drvdata->ctidev.cpu] = drvdata;
878-
if (!nr_cti_cpu++) {
879-
cpus_read_lock();
880-
ret = cpuhp_setup_state_nocalls_cpuslocked(
881-
CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
882-
"arm/coresight_cti:starting",
883-
cti_starting_cpu, cti_dying_cpu);
884-
885-
if (!ret)
886-
ret = cpu_pm_register_notifier(&cti_cpu_pm_nb);
887-
cpus_read_unlock();
888-
if (ret)
889-
goto err_out;
890-
}
891-
}
901+
ret = cti_pm_setup(drvdata);
902+
if (ret)
903+
return ret;
892904

893905
/* create dynamic attributes for connections */
894906
ret = cti_create_cons_sysfs(dev, drvdata);
895907
if (ret) {
896908
dev_err(dev, "%s: create dynamic sysfs entries failed\n",
897909
cti_desc.name);
898-
goto err_out;
910+
goto pm_release;
899911
}
900912

901913
/* set up coresight component description */
@@ -908,7 +920,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
908920
drvdata->csdev = coresight_register(&cti_desc);
909921
if (IS_ERR(drvdata->csdev)) {
910922
ret = PTR_ERR(drvdata->csdev);
911-
goto err_out;
923+
goto pm_release;
912924
}
913925

914926
/* add to list of CTI devices */
@@ -927,7 +939,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
927939
dev_info(&drvdata->csdev->dev, "CTI initialized\n");
928940
return 0;
929941

930-
err_out:
942+
pm_release:
931943
cti_pm_release(drvdata);
932944
return ret;
933945
}

drivers/hwtracing/coresight/coresight-etm4x.c

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,18 +1388,57 @@ static struct notifier_block etm4_cpu_pm_nb = {
13881388
.notifier_call = etm4_cpu_pm_notify,
13891389
};
13901390

1391-
static int etm4_cpu_pm_register(void)
1391+
/* Setup PM. Called with cpus locked. Deals with error conditions and counts */
1392+
static int etm4_pm_setup_cpuslocked(void)
13921393
{
1393-
if (IS_ENABLED(CONFIG_CPU_PM))
1394-
return cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1394+
int ret;
13951395

1396-
return 0;
1396+
if (etm4_count++)
1397+
return 0;
1398+
1399+
ret = cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1400+
if (ret)
1401+
goto reduce_count;
1402+
1403+
ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
1404+
"arm/coresight4:starting",
1405+
etm4_starting_cpu, etm4_dying_cpu);
1406+
1407+
if (ret)
1408+
goto unregister_notifier;
1409+
1410+
ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
1411+
"arm/coresight4:online",
1412+
etm4_online_cpu, NULL);
1413+
1414+
/* HP dyn state ID returned in ret on success */
1415+
if (ret > 0) {
1416+
hp_online = ret;
1417+
return 0;
1418+
}
1419+
1420+
/* failed dyn state - remove others */
1421+
cpuhp_remove_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING);
1422+
1423+
unregister_notifier:
1424+
cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1425+
1426+
reduce_count:
1427+
--etm4_count;
1428+
return ret;
13971429
}
13981430

1399-
static void etm4_cpu_pm_unregister(void)
1431+
static void etm4_pm_clear(void)
14001432
{
1401-
if (IS_ENABLED(CONFIG_CPU_PM))
1402-
cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1433+
if (--etm4_count != 0)
1434+
return;
1435+
1436+
cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1437+
cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING);
1438+
if (hp_online) {
1439+
cpuhp_remove_state_nocalls(hp_online);
1440+
hp_online = 0;
1441+
}
14031442
}
14041443

14051444
static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
@@ -1453,24 +1492,15 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
14531492
etm4_init_arch_data, drvdata, 1))
14541493
dev_err(dev, "ETM arch init failed\n");
14551494

1456-
if (!etm4_count++) {
1457-
cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
1458-
"arm/coresight4:starting",
1459-
etm4_starting_cpu, etm4_dying_cpu);
1460-
ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
1461-
"arm/coresight4:online",
1462-
etm4_online_cpu, NULL);
1463-
if (ret < 0)
1464-
goto err_arch_supported;
1465-
hp_online = ret;
1495+
ret = etm4_pm_setup_cpuslocked();
1496+
cpus_read_unlock();
14661497

1467-
ret = etm4_cpu_pm_register();
1468-
if (ret)
1469-
goto err_arch_supported;
1498+
/* etm4_pm_setup_cpuslocked() does its own cleanup - exit on error */
1499+
if (ret) {
1500+
etmdrvdata[drvdata->cpu] = NULL;
1501+
return ret;
14701502
}
14711503

1472-
cpus_read_unlock();
1473-
14741504
if (etm4_arch_supported(drvdata->arch) == false) {
14751505
ret = -EINVAL;
14761506
goto err_arch_supported;
@@ -1517,13 +1547,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
15171547

15181548
err_arch_supported:
15191549
etmdrvdata[drvdata->cpu] = NULL;
1520-
if (--etm4_count == 0) {
1521-
etm4_cpu_pm_unregister();
1522-
1523-
cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING);
1524-
if (hp_online)
1525-
cpuhp_remove_state_nocalls(hp_online);
1526-
}
1550+
etm4_pm_clear();
15271551
return ret;
15281552
}
15291553

drivers/hwtracing/intel_th/core.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,15 +1021,30 @@ int intel_th_set_output(struct intel_th_device *thdev,
10211021
{
10221022
struct intel_th_device *hub = to_intel_th_hub(thdev);
10231023
struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
1024+
int ret;
10241025

10251026
/* In host mode, this is up to the external debugger, do nothing. */
10261027
if (hub->host_mode)
10271028
return 0;
10281029

1029-
if (!hubdrv->set_output)
1030-
return -ENOTSUPP;
1030+
/*
1031+
* hub is instantiated together with the source device that
1032+
* calls here, so guaranteed to be present.
1033+
*/
1034+
hubdrv = to_intel_th_driver(hub->dev.driver);
1035+
if (!hubdrv || !try_module_get(hubdrv->driver.owner))
1036+
return -EINVAL;
1037+
1038+
if (!hubdrv->set_output) {
1039+
ret = -ENOTSUPP;
1040+
goto out;
1041+
}
1042+
1043+
ret = hubdrv->set_output(hub, master);
10311044

1032-
return hubdrv->set_output(hub, master);
1045+
out:
1046+
module_put(hubdrv->driver.owner);
1047+
return ret;
10331048
}
10341049
EXPORT_SYMBOL_GPL(intel_th_set_output);
10351050

drivers/hwtracing/intel_th/pci.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,21 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
233233
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
234234
.driver_data = (kernel_ulong_t)&intel_th_2x,
235235
},
236+
{
237+
/* Tiger Lake PCH-H */
238+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x43a6),
239+
.driver_data = (kernel_ulong_t)&intel_th_2x,
240+
},
236241
{
237242
/* Jasper Lake PCH */
238243
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6),
239244
.driver_data = (kernel_ulong_t)&intel_th_2x,
240245
},
246+
{
247+
/* Jasper Lake CPU */
248+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4e29),
249+
.driver_data = (kernel_ulong_t)&intel_th_2x,
250+
},
241251
{
242252
/* Elkhart Lake CPU */
243253
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4529),
@@ -248,6 +258,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
248258
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26),
249259
.driver_data = (kernel_ulong_t)&intel_th_2x,
250260
},
261+
{
262+
/* Emmitsburg PCH */
263+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1bcc),
264+
.driver_data = (kernel_ulong_t)&intel_th_2x,
265+
},
251266
{ 0 },
252267
};
253268

drivers/hwtracing/intel_th/sth.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ static int sth_stm_link(struct stm_data *stm_data, unsigned int master,
161161
{
162162
struct sth_device *sth = container_of(stm_data, struct sth_device, stm);
163163

164-
intel_th_set_output(to_intel_th_device(sth->dev), master);
165-
166-
return 0;
164+
return intel_th_set_output(to_intel_th_device(sth->dev), master);
167165
}
168166

169167
static int intel_th_sw_init(struct sth_device *sth)

0 commit comments

Comments
 (0)