Skip to content

Commit 3de2a3e

Browse files
committed
Merge tag 'char-misc-5.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are a number of late-arrival driver fixes for issues reported for some char/misc drivers for 5.4-rc7 These all come from the different subsystem/driver maintainers as things that they had reports for and wanted to see fixed. All of these have been in linux-next with no reported issues" * tag 'char-misc-5.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: intel_th: pci: Add Jasper Lake PCH support intel_th: pci: Add Comet Lake PCH support intel_th: msu: Fix possible memory leak in mode_store() intel_th: msu: Fix overflow in shift of an unsigned int intel_th: msu: Fix missing allocation failure check on a kstrndup intel_th: msu: Fix an uninitialized mutex intel_th: gth: Fix the window switching sequence soundwire: slave: fix scanf format soundwire: intel: fix intel_register_dai PDI offsets and numbers interconnect: Add locking in icc_set_tag() interconnect: qcom: Fix icc_onecell_data allocation soundwire: depend on ACPI || OF soundwire: depend on ACPI thunderbolt: Drop unnecessary read when writing LC command in Ice Lake thunderbolt: Fix lockdep circular locking depedency warning thunderbolt: Read DP IN adapter first two dwords in one go
2 parents a5871fc + 9d55499 commit 3de2a3e

File tree

11 files changed

+45
-26
lines changed

11 files changed

+45
-26
lines changed

drivers/hwtracing/intel_th/gth.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ static void intel_th_gth_switch(struct intel_th_device *thdev,
626626
if (!count)
627627
dev_dbg(&thdev->dev, "timeout waiting for CTS Trigger\n");
628628

629+
/* De-assert the trigger */
630+
iowrite32(0, gth->base + REG_CTS_CTL);
631+
629632
intel_th_gth_stop(gth, output, false);
630633
intel_th_gth_start(gth, output);
631634
}

drivers/hwtracing/intel_th/msu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct msc {
164164
};
165165

166166
static LIST_HEAD(msu_buffer_list);
167-
static struct mutex msu_buffer_mutex;
167+
static DEFINE_MUTEX(msu_buffer_mutex);
168168

169169
/**
170170
* struct msu_buffer_entry - internal MSU buffer bookkeeping
@@ -327,7 +327,7 @@ static size_t msc_win_total_sz(struct msc_window *win)
327327
struct msc_block_desc *bdesc = sg_virt(sg);
328328

329329
if (msc_block_wrapped(bdesc))
330-
return win->nr_blocks << PAGE_SHIFT;
330+
return (size_t)win->nr_blocks << PAGE_SHIFT;
331331

332332
size += msc_total_sz(bdesc);
333333
if (msc_block_last_written(bdesc))
@@ -1848,9 +1848,14 @@ mode_store(struct device *dev, struct device_attribute *attr, const char *buf,
18481848
len = cp - buf;
18491849

18501850
mode = kstrndup(buf, len, GFP_KERNEL);
1851+
if (!mode)
1852+
return -ENOMEM;
1853+
18511854
i = match_string(msc_mode, ARRAY_SIZE(msc_mode), mode);
1852-
if (i >= 0)
1855+
if (i >= 0) {
1856+
kfree(mode);
18531857
goto found;
1858+
}
18541859

18551860
/* Buffer sinks only work with a usable IRQ */
18561861
if (!msc->do_irq) {

drivers/hwtracing/intel_th/pci.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
199199
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x02a6),
200200
.driver_data = (kernel_ulong_t)&intel_th_2x,
201201
},
202+
{
203+
/* Comet Lake PCH */
204+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x06a6),
205+
.driver_data = (kernel_ulong_t)&intel_th_2x,
206+
},
202207
{
203208
/* Ice Lake NNPI */
204209
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x45c5),
@@ -209,6 +214,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
209214
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
210215
.driver_data = (kernel_ulong_t)&intel_th_2x,
211216
},
217+
{
218+
/* Jasper Lake PCH */
219+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6),
220+
.driver_data = (kernel_ulong_t)&intel_th_2x,
221+
},
212222
{ 0 },
213223
};
214224

drivers/interconnect/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,12 @@ void icc_set_tag(struct icc_path *path, u32 tag)
405405
if (!path)
406406
return;
407407

408+
mutex_lock(&icc_lock);
409+
408410
for (i = 0; i < path->num_nodes; i++)
409411
path->reqs[i].tag = tag;
412+
413+
mutex_unlock(&icc_lock);
410414
}
411415
EXPORT_SYMBOL_GPL(icc_set_tag);
412416

drivers/interconnect/qcom/qcs404.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ static int qnoc_probe(struct platform_device *pdev)
433433
if (!qp)
434434
return -ENOMEM;
435435

436-
data = devm_kcalloc(dev, num_nodes, sizeof(*node), GFP_KERNEL);
436+
data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes),
437+
GFP_KERNEL);
437438
if (!data)
438439
return -ENOMEM;
439440

drivers/interconnect/qcom/sdm845.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,8 @@ static int qnoc_probe(struct platform_device *pdev)
790790
if (!qp)
791791
return -ENOMEM;
792792

793-
data = devm_kcalloc(&pdev->dev, num_nodes, sizeof(*node), GFP_KERNEL);
793+
data = devm_kzalloc(&pdev->dev, struct_size(data, nodes, num_nodes),
794+
GFP_KERNEL);
794795
if (!data)
795796
return -ENOMEM;
796797

drivers/soundwire/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
menuconfig SOUNDWIRE
77
tristate "SoundWire support"
8+
depends on ACPI || OF
89
help
910
SoundWire is a 2-Pin interface with data and clock line ratified
1011
by the MIPI Alliance. SoundWire is used for transporting data

drivers/soundwire/intel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int intel_register_dai(struct sdw_intel *sdw)
900900
/* Create PCM DAIs */
901901
stream = &cdns->pcm;
902902

903-
ret = intel_create_dai(cdns, dais, INTEL_PDI_IN, stream->num_in,
903+
ret = intel_create_dai(cdns, dais, INTEL_PDI_IN, cdns->pcm.num_in,
904904
off, stream->num_ch_in, true);
905905
if (ret)
906906
return ret;
@@ -931,7 +931,7 @@ static int intel_register_dai(struct sdw_intel *sdw)
931931
if (ret)
932932
return ret;
933933

934-
off += cdns->pdm.num_bd;
934+
off += cdns->pdm.num_out;
935935
ret = intel_create_dai(cdns, dais, INTEL_PDI_BD, cdns->pdm.num_bd,
936936
off, stream->num_ch_bd, false);
937937
if (ret)

drivers/soundwire/slave.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ int sdw_of_find_slaves(struct sdw_bus *bus)
128128
struct device_node *node;
129129

130130
for_each_child_of_node(bus->dev->of_node, node) {
131-
int link_id, sdw_version, ret, len;
131+
int link_id, ret, len;
132+
unsigned int sdw_version;
132133
const char *compat = NULL;
133134
struct sdw_slave_id id;
134135
const __be32 *addr;

drivers/thunderbolt/nhi_ops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ static void icl_nhi_lc_mailbox_cmd(struct tb_nhi *nhi, enum icl_lc_mailbox_cmd c
8080
{
8181
u32 data;
8282

83-
pci_read_config_dword(nhi->pdev, VS_CAP_19, &data);
8483
data = (cmd << VS_CAP_19_CMD_SHIFT) & VS_CAP_19_CMD_MASK;
8584
pci_write_config_dword(nhi->pdev, VS_CAP_19, data | VS_CAP_19_VALID);
8685
}

0 commit comments

Comments
 (0)