<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/chipidea/host.c, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-01-15T17:28:13+00:00</updated>
<entry>
<title>USB: Use str_enable_disable-like helpers</title>
<updated>2025-01-15T17:28:13+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2025-01-14T20:05:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f386bfad038d07fc356df267592f5fd812c8cf3e'/>
<id>urn:sha1:f386bfad038d07fc356df267592f5fd812c8cf3e</id>
<content type='text'>
Replace ternary (condition ? "enable" : "disable") syntax with helpers
from string_choices.h because:
1. Simple function call with one argument is easier to read.  Ternary
   operator has three arguments and with wrapping might lead to quite
   long code.
2. Is slightly shorter thus also easier to read.
3. It brings uniformity in the text - same string.
4. Allows deduping by the linker, which results in a smaller binary
   file.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20250114-str-enable-disable-usb-v1-6-c8405df47c19@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: host: Improve port index sanitizing</title>
<updated>2024-12-04T15:11:58+00:00</updated>
<author>
<name>Xu Yang</name>
<email>xu.yang_2@nxp.com</email>
</author>
<published>2024-12-02T08:34:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=990c2a26f703f6558042d97e7abdeb3360bb6a63'/>
<id>urn:sha1:990c2a26f703f6558042d97e7abdeb3360bb6a63</id>
<content type='text'>
Coverity from Synopsys complains "Illegal address computation (OVERRUN)"
on status_reg.

After below code executed,

  port_index = wIndex &amp; 0xff;
  port_index -= (port_index &gt; 0);

the static analysis tool see the value of port_index is now between 0 and
254 (inclusive).

However, ehci_def.h define port_status as below:

  #define HCS_N_PORTS_MAX         15
  u32     port_status[HCS_N_PORTS_MAX];

So the tool think illegal array pointer may be obtained.

  status_reg = &amp;ehci-&gt;regs-&gt;port_status[port_index];

This will follow "846cbf98cbef USB: EHCI: Improve port index sanitizing" to
improve port index sanitizing.

Signed-off-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Acked-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Link: https://lore.kernel.org/r/20241202083453.704533-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: Simplify Tegra DMA alignment code</title>
<updated>2023-10-02T12:10:47+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2023-09-28T21:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2ae61a2562c0d1720545b0845829a65fb6a9c2c6'/>
<id>urn:sha1:2ae61a2562c0d1720545b0845829a65fb6a9c2c6</id>
<content type='text'>
The USB host on Tegra3 works with 32-bit alignment. Previous code tried
to align the buffer, but it did align the wrapper struct instead, so
the buffer was at a constant offset of 8 bytes (two pointers) from
expected alignment.  Since kmalloc() guarantees at least 8-byte
alignment already, the alignment-extending is removed.

Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Link: https://lore.kernel.org/r/a0d917d492b1f91ee0019e68b8e8bca9c585393f.1695934946.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: Fix DMA overwrite for Tegra</title>
<updated>2023-10-02T12:10:47+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2023-09-28T21:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7ab8716713c931ac79988f2592e1cf8b2e4fec1b'/>
<id>urn:sha1:7ab8716713c931ac79988f2592e1cf8b2e4fec1b</id>
<content type='text'>
Tegra USB controllers seem to issue DMA in full 32-bit words only and thus
may overwrite unevenly-sized buffers.  One such occurrence is detected by
SLUB when receiving a reply to a 1-byte buffer (below).  Fix this by
allocating a bounce buffer also for buffers with sizes not a multiple of 4.

=============================================================================
BUG kmalloc-64 (Tainted: G    B             ): kmalloc Redzone overwritten
-----------------------------------------------------------------------------

0x8555cd02-0x8555cd03 @offset=3330. First byte 0x0 instead of 0xcc
Allocated in usb_get_status+0x2b/0xac age=1 cpu=3 pid=41
 __kmem_cache_alloc_node+0x12f/0x1e4
 __kmalloc+0x33/0x8c
 usb_get_status+0x2b/0xac
 hub_probe+0x5e9/0xcec
 usb_probe_interface+0xbf/0x21c
 really_probe+0xa5/0x2c4
 __driver_probe_device+0x75/0x174
 driver_probe_device+0x31/0x94
 __device_attach_driver+0x65/0xc0
 bus_for_each_drv+0x4b/0x74
 __device_attach+0x69/0x120
 bus_probe_device+0x65/0x6c
 device_add+0x48b/0x5f8
 usb_set_configuration+0x37b/0x6b4
 usb_generic_driver_probe+0x37/0x68
 usb_probe_device+0x35/0xb4
Slab 0xbf622b80 objects=21 used=18 fp=0x8555cdc0 flags=0x800(slab|zone=0)
Object 0x8555cd00 @offset=3328 fp=0x00000000

Redzone  8555ccc0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  8555ccd0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  8555cce0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  8555ccf0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Object   8555cd00: 01 00 00 00 cc cc cc cc cc cc cc cc cc cc cc cc  ................
Object   8555cd10: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Object   8555cd20: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Object   8555cd30: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
Redzone  8555cd40: cc cc cc cc                                      ....
Padding  8555cd74: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a              ZZZZZZZZZZZZ
CPU: 3 PID: 41 Comm: kworker/3:1 Tainted: G    B              6.6.0-rc1mq-00118-g59786f827ea1 #1115
Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
Workqueue: usb_hub_wq hub_event
[&lt;8010ca28&gt;] (unwind_backtrace) from [&lt;801090a5&gt;] (show_stack+0x11/0x14)
[&lt;801090a5&gt;] (show_stack) from [&lt;805da2fb&gt;] (dump_stack_lvl+0x4d/0x7c)
[&lt;805da2fb&gt;] (dump_stack_lvl) from [&lt;8026464f&gt;] (check_bytes_and_report+0xb3/0xe4)
[&lt;8026464f&gt;] (check_bytes_and_report) from [&lt;802648e1&gt;] (check_object+0x261/0x290)
[&lt;802648e1&gt;] (check_object) from [&lt;802671b1&gt;] (free_to_partial_list+0x105/0x3f8)
[&lt;802671b1&gt;] (free_to_partial_list) from [&lt;80268613&gt;] (__kmem_cache_free+0x103/0x128)
[&lt;80268613&gt;] (__kmem_cache_free) from [&lt;80425a67&gt;] (usb_get_status+0x73/0xac)
[&lt;80425a67&gt;] (usb_get_status) from [&lt;80421b31&gt;] (hub_probe+0x5e9/0xcec)
[&lt;80421b31&gt;] (hub_probe) from [&lt;80428bbb&gt;] (usb_probe_interface+0xbf/0x21c)
[&lt;80428bbb&gt;] (usb_probe_interface) from [&lt;803ee13d&gt;] (really_probe+0xa5/0x2c4)
[&lt;803ee13d&gt;] (really_probe) from [&lt;803ee3d1&gt;] (__driver_probe_device+0x75/0x174)
[&lt;803ee3d1&gt;] (__driver_probe_device) from [&lt;803ee501&gt;] (driver_probe_device+0x31/0x94)
usb 1-1: device descriptor read/8, error -71

Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Link: https://lore.kernel.org/r/ef8466b834c1726f5404c95c3e192e90460146f8.1695934946.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: add workaround for chipidea PEC bug</title>
<updated>2023-08-09T12:16:06+00:00</updated>
<author>
<name>Xu Yang</name>
<email>xu.yang_2@nxp.com</email>
</author>
<published>2023-08-09T02:44:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=12e6ac69cc7e7d3367599ae26a92a0f9a18bc728'/>
<id>urn:sha1:12e6ac69cc7e7d3367599ae26a92a0f9a18bc728</id>
<content type='text'>
Some NXP processors using ChipIdea USB IP have a bug when frame babble is
detected.

Issue description:
In USB camera test, our controller is host in HS mode. In ISOC IN, when
device sends data across the micro frame, it causes the babble in host
controller. This will clear the PE bit. In spec, it also requires to set
the PEC bit and then set the PCI bit. Without the PCI interrupt, the
software does not know the PE is cleared.

This will add a flag CI_HDRC_HAS_PORTSC_PEC_MISSED to some impacted
platform datas. And the ehci host driver will assert PEC by SW when
specific conditions are satisfied.

Signed-off-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Link: https://lore.kernel.org/r/20230809024432.535160-2-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: host: add suspend/resume support for host controller</title>
<updated>2022-10-23T12:34:53+00:00</updated>
<author>
<name>Xu Yang</name>
<email>xu.yang_2@nxp.com</email>
</author>
<published>2022-10-13T15:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2f64d6a6cdfbd992e8a8c481ebf79bfa9a71325b'/>
<id>urn:sha1:2f64d6a6cdfbd992e8a8c481ebf79bfa9a71325b</id>
<content type='text'>
The controller's power may be powered off during system suspend. This
will add suspend/resume support when the controller suffers power lost.

Signed-off-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Link: https://lore.kernel.org/r/20221013151442.3262951-4-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: Add support for VBUS control with PHY</title>
<updated>2022-08-31T07:07:52+00:00</updated>
<author>
<name>Piyush Mehta</name>
<email>piyush.mehta@xilinx.com</email>
</author>
<published>2022-08-22T05:40:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=66d1c8021e1d9c97101d58fa09c33c002d96747a'/>
<id>urn:sha1:66d1c8021e1d9c97101d58fa09c33c002d96747a</id>
<content type='text'>
Some platforms make use of VBUS control over PHY which means controller
driver has to access PHY registers to turn on/off VBUS line.This patch
adds support for such platforms in chipidea.

Flag 'CI_HDRC_PHY_VBUS_CONTROL' added to support VBus control feature.

Acked-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Signed-off-by: Piyush Mehta &lt;piyush.mehta@xilinx.com&gt;
Signed-off-by: Piyush Mehta &lt;piyush.mehta@amd.com&gt;
Link: https://lore.kernel.org/r/20220822054051.2941282-1-piyush.mehta@amd.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: host: fix port index underflow and UBSAN complains</title>
<updated>2021-08-21T05:15:25+00:00</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2021-06-18T08:28:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e5d6a7c6cfae9e714a0e8ff64facd1ac68a784c6'/>
<id>urn:sha1:e5d6a7c6cfae9e714a0e8ff64facd1ac68a784c6</id>
<content type='text'>
If wIndex is 0 (and it often is), these calculations underflow and
UBSAN complains, here resolve this by not decrementing the index when
it is equal to 0, this copies the solution from commit 85e3990bea49
("USB: EHCI: avoid undefined pointer arithmetic and placate UBSAN")

Reported-by: Zhipeng Wang &lt;zhipeng.wang_1@nxp.com&gt;
Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Link: https://lore.kernel.org/r/1624004938-2399-1-git-send-email-jun.li@nxp.com
Signed-off-by: Peter Chen &lt;peter.chen@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: tegra: fix flexible_array.cocci warnings</title>
<updated>2021-03-10T08:37:15+00:00</updated>
<author>
<name>kernel test robot</name>
<email>lkp@intel.com</email>
</author>
<published>2021-02-13T20:09:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4294a8c2b8db914b029801cf2a2ba438e8785714'/>
<id>urn:sha1:4294a8c2b8db914b029801cf2a2ba438e8785714</id>
<content type='text'>
Zero-length and one-element arrays are deprecated, see
Documentation/process/deprecated.rst
Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode")
CC: Peter Geis &lt;pgwipeout@gmail.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reviewed-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2102132108040.2720@hadrien
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: tegra: Support host mode</title>
<updated>2021-01-13T10:26:34+00:00</updated>
<author>
<name>Peter Geis</name>
<email>pgwipeout@gmail.com</email>
</author>
<published>2020-12-18T12:02:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fc53d5279094e38e6363506339772a7021da2df8'/>
<id>urn:sha1:fc53d5279094e38e6363506339772a7021da2df8</id>
<content type='text'>
Add USB host mode to the Tegra HDRC driver. This allows us to benefit from
support provided by the generic ChipIdea driver instead of duplicating the
effort in a separate ehci-tegra driver.

Tested-by: Matt Merhar &lt;mattmerhar@protonmail.com&gt;
Tested-by: Nicolas Chauvet &lt;kwizart@gmail.com&gt;
Tested-by: Ion Agorria &lt;ion@agorria.com&gt;
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt;
Acked-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Signed-off-by: Peter Geis &lt;pgwipeout@gmail.com&gt;
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Link: https://lore.kernel.org/r/20201218120246.7759-6-digetx@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
