Skip to content

Commit 48cf398

Browse files
committed
Merge tag 'char-misc-6.9-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 char/misc and other driver fixes for 6.9-rc5. Included in here are the following: - binder driver fix for reported problem - speakup crash fix - mei driver fixes for reported problems - comdei driver fix - interconnect driver fixes - rtsx driver fix - peci.h kernel doc fix All of these have been in linux-next for over a week with no reported problems" * tag 'char-misc-6.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: peci: linux/peci.h: fix Excess kernel-doc description warning binder: check offset alignment in binder_get_object() comedi: vmk80xx: fix incomplete endpoint checking mei: vsc: Unregister interrupt handler for system suspend Revert "mei: vsc: Call wake_up() in the threaded IRQ handler" misc: rtsx: Fix rts5264 driver status incorrect when card removed mei: me: disable RPL-S on SPS and IGN firmwares speakup: Avoid crash on very long word interconnect: Don't access req_list while it's being manipulated interconnect: qcom: x1e80100: Remove inexistent ACV_PERF BCM
2 parents 4e90ba7 + ebaed6d commit 48cf398

File tree

11 files changed

+104
-80
lines changed

11 files changed

+104
-80
lines changed

drivers/accessibility/speakup/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static u_long get_word(struct vc_data *vc)
574574
}
575575
attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr);
576576
buf[cnt++] = attr_ch;
577-
while (tmpx < vc->vc_cols - 1) {
577+
while (tmpx < vc->vc_cols - 1 && cnt < sizeof(buf) - 1) {
578578
tmp_pos += 2;
579579
tmpx++;
580580
ch = get_char(vc, (u_short *)tmp_pos, &temp);

drivers/android/binder.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,8 +1708,10 @@ static size_t binder_get_object(struct binder_proc *proc,
17081708
size_t object_size = 0;
17091709

17101710
read_size = min_t(size_t, sizeof(*object), buffer->data_size - offset);
1711-
if (offset > buffer->data_size || read_size < sizeof(*hdr))
1711+
if (offset > buffer->data_size || read_size < sizeof(*hdr) ||
1712+
!IS_ALIGNED(offset, sizeof(u32)))
17121713
return 0;
1714+
17131715
if (u) {
17141716
if (copy_from_user(object, u + offset, read_size))
17151717
return 0;

drivers/comedi/drivers/vmk80xx.c

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -641,33 +641,22 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
641641
struct vmk80xx_private *devpriv = dev->private;
642642
struct usb_interface *intf = comedi_to_usb_interface(dev);
643643
struct usb_host_interface *iface_desc = intf->cur_altsetting;
644-
struct usb_endpoint_descriptor *ep_desc;
645-
int i;
646-
647-
if (iface_desc->desc.bNumEndpoints != 2)
648-
return -ENODEV;
649-
650-
for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
651-
ep_desc = &iface_desc->endpoint[i].desc;
652-
653-
if (usb_endpoint_is_int_in(ep_desc) ||
654-
usb_endpoint_is_bulk_in(ep_desc)) {
655-
if (!devpriv->ep_rx)
656-
devpriv->ep_rx = ep_desc;
657-
continue;
658-
}
644+
struct usb_endpoint_descriptor *ep_rx_desc, *ep_tx_desc;
645+
int ret;
659646

660-
if (usb_endpoint_is_int_out(ep_desc) ||
661-
usb_endpoint_is_bulk_out(ep_desc)) {
662-
if (!devpriv->ep_tx)
663-
devpriv->ep_tx = ep_desc;
664-
continue;
665-
}
666-
}
647+
if (devpriv->model == VMK8061_MODEL)
648+
ret = usb_find_common_endpoints(iface_desc, &ep_rx_desc,
649+
&ep_tx_desc, NULL, NULL);
650+
else
651+
ret = usb_find_common_endpoints(iface_desc, NULL, NULL,
652+
&ep_rx_desc, &ep_tx_desc);
667653

668-
if (!devpriv->ep_rx || !devpriv->ep_tx)
654+
if (ret)
669655
return -ENODEV;
670656

657+
devpriv->ep_rx = ep_rx_desc;
658+
devpriv->ep_tx = ep_tx_desc;
659+
671660
if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
672661
return -EINVAL;
673662

drivers/interconnect/core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ static struct icc_path *path_init(struct device *dev, struct icc_node *dst,
176176

177177
path->num_nodes = num_nodes;
178178

179+
mutex_lock(&icc_bw_lock);
180+
179181
for (i = num_nodes - 1; i >= 0; i--) {
180182
node->provider->users++;
181183
hlist_add_head(&path->reqs[i].req_node, &node->req_list);
@@ -186,6 +188,8 @@ static struct icc_path *path_init(struct device *dev, struct icc_node *dst,
186188
node = node->reverse;
187189
}
188190

191+
mutex_unlock(&icc_bw_lock);
192+
189193
return path;
190194
}
191195

@@ -792,12 +796,16 @@ void icc_put(struct icc_path *path)
792796
pr_err("%s: error (%d)\n", __func__, ret);
793797

794798
mutex_lock(&icc_lock);
799+
mutex_lock(&icc_bw_lock);
800+
795801
for (i = 0; i < path->num_nodes; i++) {
796802
node = path->reqs[i].node;
797803
hlist_del(&path->reqs[i].req_node);
798804
if (!WARN_ON(!node->provider->users))
799805
node->provider->users--;
800806
}
807+
808+
mutex_unlock(&icc_bw_lock);
801809
mutex_unlock(&icc_lock);
802810

803811
kfree_const(path->name);

drivers/interconnect/qcom/x1e80100.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,6 @@ static struct qcom_icc_node xm_sdc2 = {
116116
.links = { X1E80100_SLAVE_A2NOC_SNOC },
117117
};
118118

119-
static struct qcom_icc_node ddr_perf_mode_master = {
120-
.name = "ddr_perf_mode_master",
121-
.id = X1E80100_MASTER_DDR_PERF_MODE,
122-
.channels = 1,
123-
.buswidth = 4,
124-
.num_links = 1,
125-
.links = { X1E80100_SLAVE_DDR_PERF_MODE },
126-
};
127-
128119
static struct qcom_icc_node qup0_core_master = {
129120
.name = "qup0_core_master",
130121
.id = X1E80100_MASTER_QUP_CORE_0,
@@ -688,14 +679,6 @@ static struct qcom_icc_node qns_a2noc_snoc = {
688679
.links = { X1E80100_MASTER_A2NOC_SNOC },
689680
};
690681

691-
static struct qcom_icc_node ddr_perf_mode_slave = {
692-
.name = "ddr_perf_mode_slave",
693-
.id = X1E80100_SLAVE_DDR_PERF_MODE,
694-
.channels = 1,
695-
.buswidth = 4,
696-
.num_links = 0,
697-
};
698-
699682
static struct qcom_icc_node qup0_core_slave = {
700683
.name = "qup0_core_slave",
701684
.id = X1E80100_SLAVE_QUP_CORE_0,
@@ -1377,12 +1360,6 @@ static struct qcom_icc_bcm bcm_acv = {
13771360
.nodes = { &ebi },
13781361
};
13791362

1380-
static struct qcom_icc_bcm bcm_acv_perf = {
1381-
.name = "ACV_PERF",
1382-
.num_nodes = 1,
1383-
.nodes = { &ddr_perf_mode_slave },
1384-
};
1385-
13861363
static struct qcom_icc_bcm bcm_ce0 = {
13871364
.name = "CE0",
13881365
.num_nodes = 1,
@@ -1583,18 +1560,15 @@ static const struct qcom_icc_desc x1e80100_aggre2_noc = {
15831560
};
15841561

15851562
static struct qcom_icc_bcm * const clk_virt_bcms[] = {
1586-
&bcm_acv_perf,
15871563
&bcm_qup0,
15881564
&bcm_qup1,
15891565
&bcm_qup2,
15901566
};
15911567

15921568
static struct qcom_icc_node * const clk_virt_nodes[] = {
1593-
[MASTER_DDR_PERF_MODE] = &ddr_perf_mode_master,
15941569
[MASTER_QUP_CORE_0] = &qup0_core_master,
15951570
[MASTER_QUP_CORE_1] = &qup1_core_master,
15961571
[MASTER_QUP_CORE_2] = &qup2_core_master,
1597-
[SLAVE_DDR_PERF_MODE] = &ddr_perf_mode_slave,
15981572
[SLAVE_QUP_CORE_0] = &qup0_core_slave,
15991573
[SLAVE_QUP_CORE_1] = &qup1_core_slave,
16001574
[SLAVE_QUP_CORE_2] = &qup2_core_slave,

drivers/misc/cardreader/rtsx_pcr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
10021002
} else {
10031003
pcr->card_removed |= SD_EXIST;
10041004
pcr->card_inserted &= ~SD_EXIST;
1005-
if (PCI_PID(pcr) == PID_5261) {
1005+
if ((PCI_PID(pcr) == PID_5261) || (PCI_PID(pcr) == PID_5264)) {
10061006
rtsx_pci_write_register(pcr, RTS5261_FW_STATUS,
10071007
RTS5261_EXPRESS_LINK_FAIL_MASK, 0);
10081008
pcr->extra_caps |= EXTRA_CAPS_SD_EXPRESS;

drivers/misc/mei/pci-me.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
116116
{MEI_PCI_DEVICE(MEI_DEV_ID_ADP_P, MEI_ME_PCH15_CFG)},
117117
{MEI_PCI_DEVICE(MEI_DEV_ID_ADP_N, MEI_ME_PCH15_CFG)},
118118

119-
{MEI_PCI_DEVICE(MEI_DEV_ID_RPL_S, MEI_ME_PCH15_CFG)},
119+
{MEI_PCI_DEVICE(MEI_DEV_ID_RPL_S, MEI_ME_PCH15_SPS_CFG)},
120120

121121
{MEI_PCI_DEVICE(MEI_DEV_ID_MTL_M, MEI_ME_PCH15_CFG)},
122122
{MEI_PCI_DEVICE(MEI_DEV_ID_ARL_S, MEI_ME_PCH15_CFG)},

drivers/misc/mei/platform-vsc.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,25 +400,40 @@ static void mei_vsc_remove(struct platform_device *pdev)
400400
static int mei_vsc_suspend(struct device *dev)
401401
{
402402
struct mei_device *mei_dev = dev_get_drvdata(dev);
403+
struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev);
403404

404405
mei_stop(mei_dev);
405406

407+
mei_disable_interrupts(mei_dev);
408+
409+
vsc_tp_free_irq(hw->tp);
410+
406411
return 0;
407412
}
408413

409414
static int mei_vsc_resume(struct device *dev)
410415
{
411416
struct mei_device *mei_dev = dev_get_drvdata(dev);
417+
struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev);
412418
int ret;
413419

414-
ret = mei_restart(mei_dev);
420+
ret = vsc_tp_request_irq(hw->tp);
415421
if (ret)
416422
return ret;
417423

424+
ret = mei_restart(mei_dev);
425+
if (ret)
426+
goto err_free;
427+
418428
/* start timer if stopped in suspend */
419429
schedule_delayed_work(&mei_dev->timer_work, HZ);
420430

421431
return 0;
432+
433+
err_free:
434+
vsc_tp_free_irq(hw->tp);
435+
436+
return ret;
422437
}
423438

424439
static DEFINE_SIMPLE_DEV_PM_OPS(mei_vsc_pm_ops, mei_vsc_suspend, mei_vsc_resume);

drivers/misc/mei/vsc-tp.c

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ static const struct acpi_gpio_mapping vsc_tp_acpi_gpios[] = {
9494
{}
9595
};
9696

97+
static irqreturn_t vsc_tp_isr(int irq, void *data)
98+
{
99+
struct vsc_tp *tp = data;
100+
101+
atomic_inc(&tp->assert_cnt);
102+
103+
wake_up(&tp->xfer_wait);
104+
105+
return IRQ_WAKE_THREAD;
106+
}
107+
108+
static irqreturn_t vsc_tp_thread_isr(int irq, void *data)
109+
{
110+
struct vsc_tp *tp = data;
111+
112+
if (tp->event_notify)
113+
tp->event_notify(tp->event_notify_context);
114+
115+
return IRQ_HANDLED;
116+
}
117+
97118
/* wakeup firmware and wait for response */
98119
static int vsc_tp_wakeup_request(struct vsc_tp *tp)
99120
{
@@ -383,6 +404,37 @@ int vsc_tp_register_event_cb(struct vsc_tp *tp, vsc_tp_event_cb_t event_cb,
383404
}
384405
EXPORT_SYMBOL_NS_GPL(vsc_tp_register_event_cb, VSC_TP);
385406

407+
/**
408+
* vsc_tp_request_irq - request irq for vsc_tp device
409+
* @tp: vsc_tp device handle
410+
*/
411+
int vsc_tp_request_irq(struct vsc_tp *tp)
412+
{
413+
struct spi_device *spi = tp->spi;
414+
struct device *dev = &spi->dev;
415+
int ret;
416+
417+
irq_set_status_flags(spi->irq, IRQ_DISABLE_UNLAZY);
418+
ret = request_threaded_irq(spi->irq, vsc_tp_isr, vsc_tp_thread_isr,
419+
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
420+
dev_name(dev), tp);
421+
if (ret)
422+
return ret;
423+
424+
return 0;
425+
}
426+
EXPORT_SYMBOL_NS_GPL(vsc_tp_request_irq, VSC_TP);
427+
428+
/**
429+
* vsc_tp_free_irq - free irq for vsc_tp device
430+
* @tp: vsc_tp device handle
431+
*/
432+
void vsc_tp_free_irq(struct vsc_tp *tp)
433+
{
434+
free_irq(tp->spi->irq, tp);
435+
}
436+
EXPORT_SYMBOL_NS_GPL(vsc_tp_free_irq, VSC_TP);
437+
386438
/**
387439
* vsc_tp_intr_synchronize - synchronize vsc_tp interrupt
388440
* @tp: vsc_tp device handle
@@ -413,27 +465,6 @@ void vsc_tp_intr_disable(struct vsc_tp *tp)
413465
}
414466
EXPORT_SYMBOL_NS_GPL(vsc_tp_intr_disable, VSC_TP);
415467

416-
static irqreturn_t vsc_tp_isr(int irq, void *data)
417-
{
418-
struct vsc_tp *tp = data;
419-
420-
atomic_inc(&tp->assert_cnt);
421-
422-
return IRQ_WAKE_THREAD;
423-
}
424-
425-
static irqreturn_t vsc_tp_thread_isr(int irq, void *data)
426-
{
427-
struct vsc_tp *tp = data;
428-
429-
wake_up(&tp->xfer_wait);
430-
431-
if (tp->event_notify)
432-
tp->event_notify(tp->event_notify_context);
433-
434-
return IRQ_HANDLED;
435-
}
436-
437468
static int vsc_tp_match_any(struct acpi_device *adev, void *data)
438469
{
439470
struct acpi_device **__adev = data;
@@ -490,10 +521,9 @@ static int vsc_tp_probe(struct spi_device *spi)
490521
tp->spi = spi;
491522

492523
irq_set_status_flags(spi->irq, IRQ_DISABLE_UNLAZY);
493-
ret = devm_request_threaded_irq(dev, spi->irq, vsc_tp_isr,
494-
vsc_tp_thread_isr,
495-
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
496-
dev_name(dev), tp);
524+
ret = request_threaded_irq(spi->irq, vsc_tp_isr, vsc_tp_thread_isr,
525+
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
526+
dev_name(dev), tp);
497527
if (ret)
498528
return ret;
499529

@@ -522,6 +552,8 @@ static int vsc_tp_probe(struct spi_device *spi)
522552
err_destroy_lock:
523553
mutex_destroy(&tp->mutex);
524554

555+
free_irq(spi->irq, tp);
556+
525557
return ret;
526558
}
527559

@@ -532,6 +564,8 @@ static void vsc_tp_remove(struct spi_device *spi)
532564
platform_device_unregister(tp->pdev);
533565

534566
mutex_destroy(&tp->mutex);
567+
568+
free_irq(spi->irq, tp);
535569
}
536570

537571
static const struct acpi_device_id vsc_tp_acpi_ids[] = {

drivers/misc/mei/vsc-tp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ int vsc_tp_xfer(struct vsc_tp *tp, u8 cmd, const void *obuf, size_t olen,
3737
int vsc_tp_register_event_cb(struct vsc_tp *tp, vsc_tp_event_cb_t event_cb,
3838
void *context);
3939

40+
int vsc_tp_request_irq(struct vsc_tp *tp);
41+
void vsc_tp_free_irq(struct vsc_tp *tp);
42+
4043
void vsc_tp_intr_enable(struct vsc_tp *tp);
4144
void vsc_tp_intr_disable(struct vsc_tp *tp);
4245
void vsc_tp_intr_synchronize(struct vsc_tp *tp);

include/linux/peci.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ static inline struct peci_controller *to_peci_controller(void *d)
5858
/**
5959
* struct peci_device - PECI device
6060
* @dev: device object to register PECI device to the device model
61-
* @controller: manages the bus segment hosting this PECI device
6261
* @info: PECI device characteristics
6362
* @info.family: device family
6463
* @info.model: device model

0 commit comments

Comments
 (0)