History

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

Linus Torvalds committed 7 years ago

Commit 3de2a3e2 parents a5871fc 9d5549911 files · +45 −26Browse files

Unified · Split

11 files
  1. drivers/hwtracing/intel_th/gth.c +3 −0
  2. drivers/hwtracing/intel_th/msu.c +8 −3
  3. drivers/hwtracing/intel_th/pci.c +10 −0
  4. drivers/interconnect/core.c +4 −0
  5. drivers/interconnect/qcom/qcs404.c +2 −1
  6. drivers/interconnect/qcom/sdm845.c +2 −1
  7. drivers/soundwire/Kconfig +1 −0
  8. drivers/soundwire/intel.c +2 −2
  9. drivers/soundwire/slave.c +2 −1
  10. drivers/thunderbolt/nhi_ops.c +0 −1
  11. drivers/thunderbolt/switch.c +11 −17
drivers/hwtracing/intel_th/gth.c+3−0
@@ -626,6 +626,9 @@ static void intel_th_gth_switch(struct intel_th_device *thdev, · 625 unmodified lines
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+8−3
@@ -164,7 +164,7 @@ struct msc { · 163 unmodified lines
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) · 156 unmodified lines
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, · 1514 unmodified lines
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+10−0
@@ -199,6 +199,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 198 unmodified lines
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[] = { · 4 unmodified lines
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+4−0
@@ -405,8 +405,12 @@ void icc_set_tag(struct icc_path *path, u32 tag) · 404 unmodified lines
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+2−1
@@ -433,7 +433,8 @@ static int qnoc_probe(struct platform_device *pdev) · 432 unmodified lines
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+2−1
@@ -790,7 +790,8 @@ static int qnoc_probe(struct platform_device *pdev) · 789 unmodified lines
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+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
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+2−2
@@ -900,7 +900,7 @@ static int intel_register_dai(struct sdw_intel *sdw) · 899 unmodified lines
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) · 24 unmodified lines
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+2−1
@@ -128,7 +128,8 @@ int sdw_of_find_slaves(struct sdw_bus *bus) · 127 unmodified lines
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+0−1
@@ -80,7 +80,6 @@ static void icl_nhi_lc_mailbox_cmd(struct tb_nhi *nhi, enum icl_lc_mailbox_cmd c · 79 unmodified lines
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 }
drivers/thunderbolt/switch.c+11−17
@@ -896,12 +896,13 @@ int tb_dp_port_set_hops(struct tb_port *port, unsigned int video, · 895 unmodified lines
896896 */
897897 bool tb_dp_port_is_enabled(struct tb_port *port)
898898 {
899− u32 data;
899+ u32 data[2];
900900
901− if (tb_port_read(port, &data, TB_CFG_PORT, port->cap_adap, 1))
901+ if (tb_port_read(port, data, TB_CFG_PORT, port->cap_adap,
902+ ARRAY_SIZE(data)))
902903 return false;
903904
904− return !!(data & (TB_DP_VIDEO_EN | TB_DP_AUX_EN));
905+ return !!(data[0] & (TB_DP_VIDEO_EN | TB_DP_AUX_EN));
905906 }
906907
907908 /**
@@ -914,19 +915,21 @@ bool tb_dp_port_is_enabled(struct tb_port *port) · 6 unmodified lines
914915 */
915916 int tb_dp_port_enable(struct tb_port *port, bool enable)
916917 {
917− u32 data;
918+ u32 data[2];
918919 int ret;
919920
920− ret = tb_port_read(port, &data, TB_CFG_PORT, port->cap_adap, 1);
921+ ret = tb_port_read(port, data, TB_CFG_PORT, port->cap_adap,
922+ ARRAY_SIZE(data));
921923 if (ret)
922924 return ret;
923925
924926 if (enable)
925− data |= TB_DP_VIDEO_EN | TB_DP_AUX_EN;
927+ data[0] |= TB_DP_VIDEO_EN | TB_DP_AUX_EN;
926928 else
927− data &= ~(TB_DP_VIDEO_EN | TB_DP_AUX_EN);
929+ data[0] &= ~(TB_DP_VIDEO_EN | TB_DP_AUX_EN);
928930
929− return tb_port_write(port, &data, TB_CFG_PORT, port->cap_adap, 1);
931+ return tb_port_write(port, data, TB_CFG_PORT, port->cap_adap,
932+ ARRAY_SIZE(data));
930933 }
931934
932935 /* switch utility functions */
@@ -1031,13 +1034,6 @@ static int tb_switch_set_authorized(struct tb_switch *sw, unsigned int val) · 98 unmodified lines
10311034 if (sw->authorized)
10321035 goto unlock;
10331036
1034− /*
1035− * Make sure there is no PCIe rescan ongoing when a new PCIe
1036− * tunnel is created. Otherwise the PCIe rescan code might find
1037− * the new tunnel too early.
1038− */
1039− pci_lock_rescan_remove();
1040−
10411037 switch (val) {
10421038 /* Approve switch */
10431039 case 1:
@@ -1057,8 +1053,6 @@ static int tb_switch_set_authorized(struct tb_switch *sw, unsigned int val) · 13 unmodified lines
10571053 break;
10581054 }
10591055
1060− pci_unlock_rescan_remove();
1061−
10621056 if (!ret) {
10631057 sw->authorized = val;
10641058 /* Notify status change to the userspace */