Skip to content

Commit ca20f16

Browse files
committed
Merge tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char / misc driver fixes from Greg KH: "Here are some small fixes for 6.7-rc5 for a variety of small driver subsystems. Included in here are: - debugfs revert for reported issue - greybus revert for reported issue - greybus fixup for endian build warning - coresight driver fixes - nvmem driver fixes - devcoredump fix - parport new device id - ndtest build fix All of these have ben in linux-next with no reported issues" * tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: nvmem: Do not expect fixed layouts to grab a layout driver parport: Add support for Brainboxes IX/UC/PX parallel cards Revert "greybus: gb-beagleplay: Ensure le for values in transport" greybus: gb-beagleplay: Ensure le for values in transport greybus: BeaglePlay driver needs CRC_CCITT Revert "debugfs: annotate debugfs handlers vs. removal with lockdep" devcoredump: Send uevent once devcd is ready ndtest: fix typo class_regster -> class_register misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write misc: mei: client.c: return negative error code in mei_cl_write mei: pxp: fix mei_pxp_send_message return value coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base coresight: ultrasoc-smb: Config SMB buffer before register sink coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb Documentation: coresight: fix `make refcheckdocs` warning hwtracing: hisi_ptt: Don't try to attach a task hwtracing: hisi_ptt: Handle the interrupt in hardirq context hwtracing: hisi_ptt: Add dummy callback pmu::read() coresight: Fix crash when Perf and sysfs modes are used concurrently coresight: etm4x: Remove bogous __exit annotation for some functions
2 parents b10a3cc + b7c1e53 commit ca20f16

File tree

16 files changed

+79
-74
lines changed

16 files changed

+79
-74
lines changed

Documentation/trace/coresight/coresight.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Misc:
130130
Device Tree Bindings
131131
--------------------
132132

133-
See Documentation/devicetree/bindings/arm/arm,coresight-\*.yaml for details.
133+
See ``Documentation/devicetree/bindings/arm/arm,coresight-*.yaml`` for details.
134134

135135
As of this writing drivers for ITM, STMs and CTIs are not provided but are
136136
expected to be added as the solution matures.

drivers/base/devcoredump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ void dev_coredumpm(struct device *dev, struct module *owner,
362362
devcd->devcd_dev.class = &devcd_class;
363363

364364
mutex_lock(&devcd->mutex);
365+
dev_set_uevent_suppress(&devcd->devcd_dev, true);
365366
if (device_add(&devcd->devcd_dev))
366367
goto put_device;
367368

@@ -376,6 +377,8 @@ void dev_coredumpm(struct device *dev, struct module *owner,
376377
"devcoredump"))
377378
dev_warn(dev, "devcoredump create_link failed\n");
378379

380+
dev_set_uevent_suppress(&devcd->devcd_dev, false);
381+
kobject_uevent(&devcd->devcd_dev.kobj, KOBJ_ADD);
379382
INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
380383
schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
381384
mutex_unlock(&devcd->mutex);

drivers/greybus/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ if GREYBUS
2020
config GREYBUS_BEAGLEPLAY
2121
tristate "Greybus BeaglePlay driver"
2222
depends on SERIAL_DEV_BUS
23+
select CRC_CCITT
2324
help
2425
Select this option if you have a BeaglePlay where CC1352
2526
co-processor acts as Greybus SVC.

drivers/hwtracing/coresight/coresight-etm-perf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static void etm_event_start(struct perf_event *event, int flags)
493493
goto fail_end_stop;
494494

495495
/* Finally enable the tracer */
496-
if (coresight_enable_source(csdev, CS_MODE_PERF, event))
496+
if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF))
497497
goto fail_disable_path;
498498

499499
/*
@@ -587,7 +587,7 @@ static void etm_event_stop(struct perf_event *event, int mode)
587587
return;
588588

589589
/* stop tracer */
590-
coresight_disable_source(csdev, event);
590+
source_ops(csdev)->disable(csdev, event);
591591

592592
/* tell the core */
593593
event->hw.state = PERF_HES_STOPPED;

drivers/hwtracing/coresight/coresight-etm4x-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,7 @@ static void clear_etmdrvdata(void *info)
22242224
per_cpu(delayed_probe, cpu) = NULL;
22252225
}
22262226

2227-
static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata)
2227+
static void etm4_remove_dev(struct etmv4_drvdata *drvdata)
22282228
{
22292229
bool had_delayed_probe;
22302230
/*
@@ -2253,15 +2253,15 @@ static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata)
22532253
}
22542254
}
22552255

2256-
static void __exit etm4_remove_amba(struct amba_device *adev)
2256+
static void etm4_remove_amba(struct amba_device *adev)
22572257
{
22582258
struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev);
22592259

22602260
if (drvdata)
22612261
etm4_remove_dev(drvdata);
22622262
}
22632263

2264-
static int __exit etm4_remove_platform_dev(struct platform_device *pdev)
2264+
static int etm4_remove_platform_dev(struct platform_device *pdev)
22652265
{
22662266
struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
22672267

drivers/hwtracing/coresight/ultrasoc-smb.c

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int smb_open(struct inode *inode, struct file *file)
9999
struct smb_drv_data, miscdev);
100100
int ret = 0;
101101

102-
mutex_lock(&drvdata->mutex);
102+
spin_lock(&drvdata->spinlock);
103103

104104
if (drvdata->reading) {
105105
ret = -EBUSY;
@@ -115,7 +115,7 @@ static int smb_open(struct inode *inode, struct file *file)
115115

116116
drvdata->reading = true;
117117
out:
118-
mutex_unlock(&drvdata->mutex);
118+
spin_unlock(&drvdata->spinlock);
119119

120120
return ret;
121121
}
@@ -132,10 +132,8 @@ static ssize_t smb_read(struct file *file, char __user *data, size_t len,
132132
if (!len)
133133
return 0;
134134

135-
mutex_lock(&drvdata->mutex);
136-
137135
if (!sdb->data_size)
138-
goto out;
136+
return 0;
139137

140138
to_copy = min(sdb->data_size, len);
141139

@@ -145,20 +143,15 @@ static ssize_t smb_read(struct file *file, char __user *data, size_t len,
145143

146144
if (copy_to_user(data, sdb->buf_base + sdb->buf_rdptr, to_copy)) {
147145
dev_dbg(dev, "Failed to copy data to user\n");
148-
to_copy = -EFAULT;
149-
goto out;
146+
return -EFAULT;
150147
}
151148

152149
*ppos += to_copy;
153-
154150
smb_update_read_ptr(drvdata, to_copy);
155-
156-
dev_dbg(dev, "%zu bytes copied\n", to_copy);
157-
out:
158151
if (!sdb->data_size)
159152
smb_reset_buffer(drvdata);
160-
mutex_unlock(&drvdata->mutex);
161153

154+
dev_dbg(dev, "%zu bytes copied\n", to_copy);
162155
return to_copy;
163156
}
164157

@@ -167,9 +160,9 @@ static int smb_release(struct inode *inode, struct file *file)
167160
struct smb_drv_data *drvdata = container_of(file->private_data,
168161
struct smb_drv_data, miscdev);
169162

170-
mutex_lock(&drvdata->mutex);
163+
spin_lock(&drvdata->spinlock);
171164
drvdata->reading = false;
172-
mutex_unlock(&drvdata->mutex);
165+
spin_unlock(&drvdata->spinlock);
173166

174167
return 0;
175168
}
@@ -262,7 +255,7 @@ static int smb_enable(struct coresight_device *csdev, enum cs_mode mode,
262255
struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent);
263256
int ret = 0;
264257

265-
mutex_lock(&drvdata->mutex);
258+
spin_lock(&drvdata->spinlock);
266259

267260
/* Do nothing, the trace data is reading by other interface now */
268261
if (drvdata->reading) {
@@ -294,7 +287,7 @@ static int smb_enable(struct coresight_device *csdev, enum cs_mode mode,
294287

295288
dev_dbg(&csdev->dev, "Ultrasoc SMB enabled\n");
296289
out:
297-
mutex_unlock(&drvdata->mutex);
290+
spin_unlock(&drvdata->spinlock);
298291

299292
return ret;
300293
}
@@ -304,7 +297,7 @@ static int smb_disable(struct coresight_device *csdev)
304297
struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent);
305298
int ret = 0;
306299

307-
mutex_lock(&drvdata->mutex);
300+
spin_lock(&drvdata->spinlock);
308301

309302
if (drvdata->reading) {
310303
ret = -EBUSY;
@@ -327,7 +320,7 @@ static int smb_disable(struct coresight_device *csdev)
327320

328321
dev_dbg(&csdev->dev, "Ultrasoc SMB disabled\n");
329322
out:
330-
mutex_unlock(&drvdata->mutex);
323+
spin_unlock(&drvdata->spinlock);
331324

332325
return ret;
333326
}
@@ -408,7 +401,7 @@ static unsigned long smb_update_buffer(struct coresight_device *csdev,
408401
if (!buf)
409402
return 0;
410403

411-
mutex_lock(&drvdata->mutex);
404+
spin_lock(&drvdata->spinlock);
412405

413406
/* Don't do anything if another tracer is using this sink. */
414407
if (atomic_read(&csdev->refcnt) != 1)
@@ -432,7 +425,7 @@ static unsigned long smb_update_buffer(struct coresight_device *csdev,
432425
if (!buf->snapshot && lost)
433426
perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED);
434427
out:
435-
mutex_unlock(&drvdata->mutex);
428+
spin_unlock(&drvdata->spinlock);
436429

437430
return data_size;
438431
}
@@ -484,7 +477,6 @@ static int smb_init_data_buffer(struct platform_device *pdev,
484477
static void smb_init_hw(struct smb_drv_data *drvdata)
485478
{
486479
smb_disable_hw(drvdata);
487-
smb_reset_buffer(drvdata);
488480

489481
writel(SMB_LB_CFG_LO_DEFAULT, drvdata->base + SMB_LB_CFG_LO_REG);
490482
writel(SMB_LB_CFG_HI_DEFAULT, drvdata->base + SMB_LB_CFG_HI_REG);
@@ -590,37 +582,33 @@ static int smb_probe(struct platform_device *pdev)
590582
return ret;
591583
}
592584

593-
mutex_init(&drvdata->mutex);
585+
ret = smb_config_inport(dev, true);
586+
if (ret)
587+
return ret;
588+
589+
smb_reset_buffer(drvdata);
590+
platform_set_drvdata(pdev, drvdata);
591+
spin_lock_init(&drvdata->spinlock);
594592
drvdata->pid = -1;
595593

596594
ret = smb_register_sink(pdev, drvdata);
597595
if (ret) {
596+
smb_config_inport(&pdev->dev, false);
598597
dev_err(dev, "Failed to register SMB sink\n");
599598
return ret;
600599
}
601600

602-
ret = smb_config_inport(dev, true);
603-
if (ret) {
604-
smb_unregister_sink(drvdata);
605-
return ret;
606-
}
607-
608-
platform_set_drvdata(pdev, drvdata);
609-
610601
return 0;
611602
}
612603

613604
static int smb_remove(struct platform_device *pdev)
614605
{
615606
struct smb_drv_data *drvdata = platform_get_drvdata(pdev);
616-
int ret;
617-
618-
ret = smb_config_inport(&pdev->dev, false);
619-
if (ret)
620-
return ret;
621607

622608
smb_unregister_sink(drvdata);
623609

610+
smb_config_inport(&pdev->dev, false);
611+
624612
return 0;
625613
}
626614

drivers/hwtracing/coresight/ultrasoc-smb.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define _ULTRASOC_SMB_H
99

1010
#include <linux/miscdevice.h>
11-
#include <linux/mutex.h>
11+
#include <linux/spinlock.h>
1212

1313
/* Offset of SMB global registers */
1414
#define SMB_GLB_CFG_REG 0x00
@@ -105,7 +105,7 @@ struct smb_data_buffer {
105105
* @csdev: Component vitals needed by the framework.
106106
* @sdb: Data buffer for SMB.
107107
* @miscdev: Specifics to handle "/dev/xyz.smb" entry.
108-
* @mutex: Control data access to one at a time.
108+
* @spinlock: Control data access to one at a time.
109109
* @reading: Synchronise user space access to SMB buffer.
110110
* @pid: Process ID of the process being monitored by the
111111
* session that is using this component.
@@ -116,7 +116,7 @@ struct smb_drv_data {
116116
struct coresight_device *csdev;
117117
struct smb_data_buffer sdb;
118118
struct miscdevice miscdev;
119-
struct mutex mutex;
119+
spinlock_t spinlock;
120120
bool reading;
121121
pid_t pid;
122122
enum cs_mode mode;

drivers/hwtracing/ptt/hisi_ptt.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ static int hisi_ptt_register_irq(struct hisi_ptt *hisi_ptt)
342342
return ret;
343343

344344
hisi_ptt->trace_irq = pci_irq_vector(pdev, HISI_PTT_TRACE_DMA_IRQ);
345-
ret = devm_request_threaded_irq(&pdev->dev, hisi_ptt->trace_irq,
346-
NULL, hisi_ptt_isr, 0,
347-
DRV_NAME, hisi_ptt);
345+
ret = devm_request_irq(&pdev->dev, hisi_ptt->trace_irq, hisi_ptt_isr,
346+
IRQF_NOBALANCING | IRQF_NO_THREAD, DRV_NAME,
347+
hisi_ptt);
348348
if (ret) {
349349
pci_err(pdev, "failed to request irq %d, ret = %d\n",
350350
hisi_ptt->trace_irq, ret);
@@ -1000,6 +1000,9 @@ static int hisi_ptt_pmu_event_init(struct perf_event *event)
10001000
return -EOPNOTSUPP;
10011001
}
10021002

1003+
if (event->attach_state & PERF_ATTACH_TASK)
1004+
return -EOPNOTSUPP;
1005+
10031006
if (event->attr.type != hisi_ptt->hisi_ptt_pmu.type)
10041007
return -ENOENT;
10051008

@@ -1178,6 +1181,10 @@ static void hisi_ptt_pmu_del(struct perf_event *event, int flags)
11781181
hisi_ptt_pmu_stop(event, PERF_EF_UPDATE);
11791182
}
11801183

1184+
static void hisi_ptt_pmu_read(struct perf_event *event)
1185+
{
1186+
}
1187+
11811188
static void hisi_ptt_remove_cpuhp_instance(void *hotplug_node)
11821189
{
11831190
cpuhp_state_remove_instance_nocalls(hisi_ptt_pmu_online, hotplug_node);
@@ -1221,6 +1228,7 @@ static int hisi_ptt_register_pmu(struct hisi_ptt *hisi_ptt)
12211228
.stop = hisi_ptt_pmu_stop,
12221229
.add = hisi_ptt_pmu_add,
12231230
.del = hisi_ptt_pmu_del,
1231+
.read = hisi_ptt_pmu_read,
12241232
};
12251233

12261234
reg = readl(hisi_ptt->iobase + HISI_PTT_LOCATION);

drivers/misc/mei/client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, unsigned long time
20112011

20122012
mei_hdr = mei_msg_hdr_init(cb);
20132013
if (IS_ERR(mei_hdr)) {
2014-
rets = -PTR_ERR(mei_hdr);
2014+
rets = PTR_ERR(mei_hdr);
20152015
mei_hdr = NULL;
20162016
goto err;
20172017
}
@@ -2032,7 +2032,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, unsigned long time
20322032

20332033
hbuf_slots = mei_hbuf_empty_slots(dev);
20342034
if (hbuf_slots < 0) {
2035-
rets = -EOVERFLOW;
2035+
buf_len = -EOVERFLOW;
20362036
goto out;
20372037
}
20382038

drivers/misc/mei/pxp/mei_pxp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ mei_pxp_send_message(struct device *dev, const void *message, size_t size, unsig
8484
byte = ret;
8585
break;
8686
}
87+
return byte;
8788
}
8889

89-
return byte;
90+
return 0;
9091
}
9192

9293
/**

0 commit comments

Comments
 (0)