<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/typec, branch v5.2.16</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.2.16</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.2.16'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-09-06T08:23:44+00:00</updated>
<entry>
<title>typec: tcpm: fix a typo in the comparison of pdo_max_voltage</title>
<updated>2019-09-06T08:23:44+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-08-22T13:52:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d886915cd91b4393ab7649af6021a74fe4441270'/>
<id>urn:sha1:d886915cd91b4393ab7649af6021a74fe4441270</id>
<content type='text'>
commit a684d8fd87182090ee96e34519ecdf009cef093a upstream.

There appears to be a typo in the comparison of pdo_max_voltage[i]
with the previous value, currently it is checking against the
array pdo_min_voltage rather than pdo_max_voltage. I believe this
is a typo. Fix this.

Addresses-Coverity: ("Copy-paste error")
Fixes: 5007e1b5db73 ("typec: tcpm: Validate source and sink caps")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20190822135212.10195-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests</title>
<updated>2019-08-16T08:10:57+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2019-08-02T16:03:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=82bd5bfb0029cff7f0a0bb4e435f8114232d6e1e'/>
<id>urn:sha1:82bd5bfb0029cff7f0a0bb4e435f8114232d6e1e</id>
<content type='text'>
commit 88d02c9ba2e83fc22d37ccb1f11c62ea6fc9ae50 upstream.

TCPM may receive PD messages associated with unknown or unsupported
alternate modes. If that happens, calls to typec_match_altmode()
will return NULL. The tcpm code does not currently take this into
account. This results in crashes.

Unable to handle kernel NULL pointer dereference at virtual address 000001f0
pgd = 41dad9a1
[000001f0] *pgd=00000000
Internal error: Oops: 5 [#1] THUMB2
Modules linked in: tcpci tcpm
CPU: 0 PID: 2338 Comm: kworker/u2:0 Not tainted 5.1.18-sama5-armv7-r2 #6
Hardware name: Atmel SAMA5
Workqueue: 2-0050 tcpm_pd_rx_handler [tcpm]
PC is at typec_altmode_attention+0x0/0x14
LR is at tcpm_pd_rx_handler+0xa3b/0xda0 [tcpm]
...
[&lt;c03fbee8&gt;] (typec_altmode_attention) from [&lt;bf8030fb&gt;]
				(tcpm_pd_rx_handler+0xa3b/0xda0 [tcpm])
[&lt;bf8030fb&gt;] (tcpm_pd_rx_handler [tcpm]) from [&lt;c012082b&gt;]
				(process_one_work+0x123/0x2a8)
[&lt;c012082b&gt;] (process_one_work) from [&lt;c0120a6d&gt;]
				(worker_thread+0xbd/0x3b0)
[&lt;c0120a6d&gt;] (worker_thread) from [&lt;c012431f&gt;] (kthread+0xcf/0xf4)
[&lt;c012431f&gt;] (kthread) from [&lt;c01010f9&gt;] (ret_from_fork+0x11/0x38)

Ignore PD messages if the associated alternate mode is not supported.

Fixes: e9576fe8e605c ("usb: typec: tcpm: Support for Alternate Modes")
Cc: stable &lt;stable@vger.kernel.org&gt;
Reported-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Cc: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Tested-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/1564761822-13984-1-git-send-email-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: typec: tcpm: Add NULL check before dereferencing config</title>
<updated>2019-08-16T08:10:57+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2019-07-24T14:38:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b7312585859d05e3d4c3c5799c355387e7a61e0e'/>
<id>urn:sha1:b7312585859d05e3d4c3c5799c355387e7a61e0e</id>
<content type='text'>
commit 1957de95d425d1c06560069dc7277a73a8b28683 upstream.

When instantiating tcpm on an NXP OM 13588 board with NXP PTN5110,
the following crash is seen when writing into the 'preferred_role'
sysfs attribute.

Unable to handle kernel NULL pointer dereference at virtual address 00000028
pgd = f69149ad
[00000028] *pgd=00000000
Internal error: Oops: 5 [#1] THUMB2
Modules linked in: tcpci tcpm
CPU: 0 PID: 1882 Comm: bash Not tainted 5.1.18-sama5-armv7-r2 #4
Hardware name: Atmel SAMA5
PC is at tcpm_try_role+0x3a/0x4c [tcpm]
LR is at tcpm_try_role+0x15/0x4c [tcpm]
pc : [&lt;bf8000e2&gt;]    lr : [&lt;bf8000bd&gt;]    psr: 60030033
sp : dc1a1e88  ip : c03fb47d  fp : 00000000
r10: dc216190  r9 : dc1a1f78  r8 : 00000001
r7 : df4ae044  r6 : dd032e90  r5 : dd1ce340  r4 : df4ae054
r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : df4ae044
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment none
Control: 50c53c7d  Table: 3efec059  DAC: 00000051
Process bash (pid: 1882, stack limit = 0x6a6d4aa5)
Stack: (0xdc1a1e88 to 0xdc1a2000)
1e80:                   dd05d808 dd1ce340 00000001 00000007 dd1ce340 c03fb4a7
1ea0: 00000007 00000007 dc216180 00000000 00000000 c01e1e03 00000000 00000000
1ec0: c0907008 dee98b40 c01e1d5d c06106c4 00000000 00000000 00000007 c0194e8b
1ee0: 0000000a 00000400 00000000 c01a97db dc22bf00 ffffe000 df4b6a00 df745900
1f00: 00000001 00000001 000000dd c01a9c2f 7aeab3be c0907008 00000000 dc22bf00
1f20: c0907008 00000000 00000000 00000000 00000000 7aeab3be 00000007 dee98b40
1f40: 005dc318 dc1a1f78 00000000 00000000 00000007 c01969f7 0000000a c01a20cb
1f60: dee98b40 c0907008 dee98b40 005dc318 00000000 c0196b9b 00000000 00000000
1f80: dee98b40 7aeab3be 00000074 005dc318 b6f3bdb0 00000004 c0101224 dc1a0000
1fa0: 00000004 c0101001 00000074 005dc318 00000001 005dc318 00000007 00000000
1fc0: 00000074 005dc318 b6f3bdb0 00000004 00000007 00000007 00000000 00000000
1fe0: 00000004 be800880 b6ed35b3 b6e5c746 60030030 00000001 00000000 00000000
[&lt;bf8000e2&gt;] (tcpm_try_role [tcpm]) from [&lt;c03fb4a7&gt;] (preferred_role_store+0x2b/0x5c)
[&lt;c03fb4a7&gt;] (preferred_role_store) from [&lt;c01e1e03&gt;] (kernfs_fop_write+0xa7/0x150)
[&lt;c01e1e03&gt;] (kernfs_fop_write) from [&lt;c0194e8b&gt;] (__vfs_write+0x1f/0x104)
[&lt;c0194e8b&gt;] (__vfs_write) from [&lt;c01969f7&gt;] (vfs_write+0x6b/0x104)
[&lt;c01969f7&gt;] (vfs_write) from [&lt;c0196b9b&gt;] (ksys_write+0x43/0x94)
[&lt;c0196b9b&gt;] (ksys_write) from [&lt;c0101001&gt;] (ret_fast_syscall+0x1/0x62)

Since commit 96232cbc6c994 ("usb: typec: tcpm: support get typec and pd
config from device properties"), the 'config' pointer in struct tcpc_dev
is optional when registering a Type-C port. Since it is optional, we have
to check if it is NULL before dereferencing it.

Reported-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Cc: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Fixes: 96232cbc6c994 ("usb: typec: tcpm: support get typec and pd config from device properties")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Reviewed-by: Jun Li &lt;jun.li@nxp.com&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/1563979112-22483-1-git-send-email-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: typec: tcpm: remove tcpm dir if no children</title>
<updated>2019-08-16T08:10:57+00:00</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2019-07-17T08:06:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4f5f21cfe59a8401bfb6e18e03a6a112b431e282'/>
<id>urn:sha1:4f5f21cfe59a8401bfb6e18e03a6a112b431e282</id>
<content type='text'>
commit 12ca7297b8855c0af1848503d37196159b24e6b9 upstream.

If config tcpm as module, module unload will not remove tcpm dir,
then the next module load will have problem: the rootdir is NULL
but tcpm dir is still there, so tcpm_debugfs_init() will create
tcpm dir again with failure, fix it by remove the tcpm dir if no
children.

Cc: stable@vger.kernel.org # v4.15+
Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20190717080646.30421-2-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: typec: tcpm: free log buf memory when remove debug file</title>
<updated>2019-08-16T08:10:57+00:00</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2019-07-17T08:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ba2bf3bad73b3e54a1ec07c7bea159e11f61c6fa'/>
<id>urn:sha1:ba2bf3bad73b3e54a1ec07c7bea159e11f61c6fa</id>
<content type='text'>
commit fd5da3e2cc61b4a7c877172fdc9348c82cf6ccfc upstream.

The logbuffer memory should be freed when remove debug file.

Cc: stable@vger.kernel.org # v4.15+
Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20190717080646.30421-1-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: typec: ucsi: ccg: Fix uninitilized symbol error</title>
<updated>2019-08-16T08:10:56+00:00</updated>
<author>
<name>Heikki Krogerus</name>
<email>heikki.krogerus@linux.intel.com</email>
</author>
<published>2019-08-01T07:55:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad9b592910d79c4623b00f5befb0e2d8e9d0cd57'/>
<id>urn:sha1:ad9b592910d79c4623b00f5befb0e2d8e9d0cd57</id>
<content type='text'>
commit a29d56c2ed24ad33062bfdafdec9e34149715320 upstream.

Fix smatch error:
drivers/usb/typec/ucsi/ucsi_ccg.c:975 ccg_fw_update() error: uninitialized symbol 'err'.

Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
Cc: stable@vger.kernel.org
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20190801075512.24354-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/usb/typec/tps6598x.c: fix 4CC cmd write</title>
<updated>2019-07-14T06:01:11+00:00</updated>
<author>
<name>Nikolaus Voss</name>
<email>nikolaus.voss@loewensteinmedical.de</email>
</author>
<published>2019-06-28T09:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=99189d80bb9ad7fabbf5ee322b5a0f4cc250b878'/>
<id>urn:sha1:99189d80bb9ad7fabbf5ee322b5a0f4cc250b878</id>
<content type='text'>
commit 2681795b5e7a5bf336537661010072f4c22cea31 upstream.

Writing 4CC commands with tps6598x_write_4cc() already has
a pointer arg, don't reference it when using as arg to
tps6598x_block_write(). Correcting this enforces the constness
of the pointer to propagate to tps6598x_block_write(), so add
the const qualifier there to avoid the warning.

Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers")
Signed-off-by: Nikolaus Voss &lt;nikolaus.voss@loewensteinmedical.de&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/usb/typec/tps6598x.c: fix portinfo width</title>
<updated>2019-07-14T06:01:11+00:00</updated>
<author>
<name>Nikolaus Voss</name>
<email>nikolaus.voss@loewensteinmedical.de</email>
</author>
<published>2019-06-28T09:01:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=582aa3acf081cf5ab49c4f4a5dfa4a14e4dfebc1'/>
<id>urn:sha1:582aa3acf081cf5ab49c4f4a5dfa4a14e4dfebc1</id>
<content type='text'>
commit 05da75fc651138e51ff74ace97174349910463f5 upstream.

Portinfo bit field is 3 bits wide, not 2 bits. This led to
a wrong driver configuration for some tps6598x configurations.

Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers")
Signed-off-by: Nikolaus Voss &lt;nikolaus.voss@loewensteinmedical.de&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: typec: Make sure an alt mode exist before getting its partner</title>
<updated>2019-06-12T15:13:02+00:00</updated>
<author>
<name>Heikki Krogerus</name>
<email>heikki.krogerus@linux.intel.com</email>
</author>
<published>2019-06-12T14:15:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f54a85db5df67df8161739a4b2f9c2b7ab219fe'/>
<id>urn:sha1:5f54a85db5df67df8161739a4b2f9c2b7ab219fe</id>
<content type='text'>
Adding check to typec_altmode_get_partner() to prevent
potential NULL pointer dereference.

Reported-by: Vladimir Yerilov &lt;openmindead@gmail.com&gt;
Fixes: ad74b8649bea ("usb: typec: ucsi: Preliminary support for alternate modes")
Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: typec: ucsi: ccg: fix memory leak in do_flash</title>
<updated>2019-06-03T12:24:57+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-05-27T18:10:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2649939ad750db48f94d3cdab26e3a0115672e6b'/>
<id>urn:sha1:2649939ad750db48f94d3cdab26e3a0115672e6b</id>
<content type='text'>
In case memory resources for *fw* were successfully allocated,
release them before return.

Addresses-Coverity-ID: 1445499 ("Resource leak")
Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
