<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/cdns3, branch v5.9.12</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.9.12</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.9.12'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-12-02T07:51:53+00:00</updated>
<entry>
<title>usb: cdns3: gadget: calculate TD_SIZE based on TD</title>
<updated>2020-12-02T07:51:53+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-11-03T14:16:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9d9bc23196f00b43767980ef5691c40aafbc386e'/>
<id>urn:sha1:9d9bc23196f00b43767980ef5691c40aafbc386e</id>
<content type='text'>
[ Upstream commit 40252dd7cf7cad81c784c695c36bc475b518f0ea ]

The TRB entry TD_SIZE is the packet number for the TD (request) but not the
each TRB, so it only needs to be assigned for the first TRB during the TD,
and the value of it is for TD too.

Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: gadget: fix some endian issues</title>
<updated>2020-12-02T07:51:53+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-08-21T03:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f43e7b4513c15e247cd19fcd6c5c112736c3de8c'/>
<id>urn:sha1:f43e7b4513c15e247cd19fcd6c5c112736c3de8c</id>
<content type='text'>
[ Upstream commit 8dafb3c04df3b3b5a3ee2c7f5d8285a8b2f0aa78 ]

It is found by sparse.

Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: gadget: suspicious implicit sign extension</title>
<updated>2020-11-10T11:39:07+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-10-22T00:55:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f23480fd3e6d92015f15163c1090ab2d48e3fe2'/>
<id>urn:sha1:5f23480fd3e6d92015f15163c1090ab2d48e3fe2</id>
<content type='text'>
[ Upstream commit 5fca3f062879f8e5214c56f3e3e2be6727900f5d ]

The code:
trb-&gt;length = cpu_to_le32(TRB_BURST_LEN(priv_ep-&gt;trb_burst_size)
	       	| TRB_LEN(length));

TRB_BURST_LEN(priv_ep-&gt;trb_burst_size) may be overflow for int 32 if
priv_ep-&gt;trb_burst_size is equal or larger than 0x80;

Below is the Coverity warning:
sign_extension: Suspicious implicit sign extension: priv_ep-&gt;trb_burst_size
with type u8 (8 bits, unsigned) is promoted in priv_ep-&gt;trb_burst_size &lt;&lt; 24
to type int (32 bits, signed), then sign-extended to type unsigned long
(64 bits, unsigned). If priv_ep-&gt;trb_burst_size &lt;&lt; 24 is greater than 0x7FFFFFFF,
the upper bits of the result will all be 1.

To fix it, it needs to add an explicit cast to unsigned int type for ((p) &lt;&lt; 24).

Reviewed-by: Jun Li &lt;jun.li@nxp.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: Fix on-chip memory overflow issue</title>
<updated>2020-11-05T10:51:39+00:00</updated>
<author>
<name>Pawel Laszczak</name>
<email>pawell@cadence.com</email>
</author>
<published>2020-10-22T00:55:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4c67e1218fb774fdb09c0a010751dfb5d638493'/>
<id>urn:sha1:c4c67e1218fb774fdb09c0a010751dfb5d638493</id>
<content type='text'>
commit 52d3967704aea6cb316d419a33a5e1d56d33a3c1 upstream.

Patch fixes issue caused setting On-chip memory overflow bit in usb_sts
register. The issue occurred because EP_CFG register was set twice
before USB_STS.CFGSTS was set. Every write operation on EP_CFG.BUFFERING
causes that controller increases internal counter holding the number
of reserved on-chip buffers. First time this register was updated in
function cdns3_ep_config before delegating SET_CONFIGURATION request
to class driver and again it was updated when class wanted to enable
endpoint.  This patch fixes this issue by configuring endpoints
enabled by class driver in cdns3_gadget_ep_enable and others just
before status stage.

Cc: stable@vger.kernel.org#v5.8+
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Reported-and-tested-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: cdns3: gadget: free interrupt after gadget has deleted</title>
<updated>2020-10-29T09:12:22+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-09-01T02:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c9c31dcdb02a7b65329c98a402111b2db822b402'/>
<id>urn:sha1:c9c31dcdb02a7b65329c98a402111b2db822b402</id>
<content type='text'>
commit 98df91f8840cf750a0bc7c4c5d6b6085bac945b3 upstream.

The interrupt may occur during the gadget deletion, it fixes the
below oops.

[ 2394.974604] configfs-gadget gadget: suspend
[ 2395.042578] configfs-gadget 5b130000.usb: unregistering UDC driver [g1]
[ 2395.382562] irq 229: nobody cared (try booting with the "irqpoll" option)
[ 2395.389362] CPU: 0 PID: 301 Comm: kworker/u12:6 Not tainted 5.8.0-rc3-next-20200703-00060-g2f13b83cbf30-dirty #456
[ 2395.399712] Hardware name: Freescale i.MX8QM MEK (DT)
[ 2395.404782] Workqueue: 2-0051 tcpm_state_machine_work
[ 2395.409832] Call trace:
[ 2395.412289]  dump_backtrace+0x0/0x1d0
[ 2395.415950]  show_stack+0x1c/0x28
[ 2395.419271]  dump_stack+0xbc/0x118
[ 2395.422678]  __report_bad_irq+0x50/0xe0
[ 2395.426513]  note_interrupt+0x2cc/0x38c
[ 2395.430355]  handle_irq_event_percpu+0x88/0x90
[ 2395.434800]  handle_irq_event+0x4c/0xe8
[ 2395.438640]  handle_fasteoi_irq+0xbc/0x168
[ 2395.442740]  generic_handle_irq+0x34/0x48
[ 2395.446752]  __handle_domain_irq+0x68/0xc0
[ 2395.450846]  gic_handle_irq+0x64/0x150
[ 2395.454596]  el1_irq+0xb8/0x180
[ 2395.457733]  __do_softirq+0xac/0x3b8
[ 2395.461310]  irq_exit+0xc0/0xe0
[ 2395.464448]  __handle_domain_irq+0x6c/0xc0
[ 2395.468540]  gic_handle_irq+0x64/0x150
[ 2395.472295]  el1_irq+0xb8/0x180
[ 2395.475436]  _raw_spin_unlock_irqrestore+0x14/0x48
[ 2395.480232]  usb_gadget_disconnect+0x120/0x140
[ 2395.484678]  usb_gadget_remove_driver+0xb4/0xd0
[ 2395.489208]  usb_del_gadget+0x6c/0xc8
[ 2395.492872]  cdns3_gadget_exit+0x5c/0x120
[ 2395.496882]  cdns3_role_stop+0x60/0x90
[ 2395.500634]  cdns3_role_set+0x64/0xd8
[ 2395.504301]  usb_role_switch_set_role.part.0+0x3c/0x90
[ 2395.509444]  usb_role_switch_set_role+0x20/0x30
[ 2395.513978]  tcpm_mux_set+0x60/0xf8
[ 2395.517470]  tcpm_reset_port+0xa4/0xf0
[ 2395.521222]  tcpm_detach.part.0+0x44/0x50
[ 2395.525227]  tcpm_state_machine_work+0x8b0/0x2360
[ 2395.529932]  process_one_work+0x1c8/0x470
[ 2395.533939]  worker_thread+0x50/0x420
[ 2395.537603]  kthread+0x148/0x168
[ 2395.540830]  ret_from_fork+0x10/0x18
[ 2395.544399] handlers:
[ 2395.546671] [&lt;000000008dea28da&gt;] cdns3_wakeup_irq
[ 2395.551375] [&lt;000000009fee5c61&gt;] cdns3_drd_irq threaded [&lt;000000005148eaec&gt;] cdns3_drd_thread_irq
[ 2395.560255] Disabling IRQ #229
[ 2395.563454] configfs-gadget gadget: unbind function 'Mass Storage Function'/000000000132f835
[ 2395.563657] configfs-gadget gadget: unbind
[ 2395.563917] udc 5b130000.usb: releasing '5b130000.usb'

Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: cdns3: convert to devm_platform_ioremap_resource_byname</title>
<updated>2020-07-29T14:49:37+00:00</updated>
<author>
<name>Chunfeng Yun</name>
<email>chunfeng.yun@mediatek.com</email>
</author>
<published>2020-07-22T07:51:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e8b59c1fc6bf78b8117efd8d354bcb99efed2ea'/>
<id>urn:sha1:7e8b59c1fc6bf78b8117efd8d354bcb99efed2ea</id>
<content type='text'>
Use devm_platform_ioremap_resource_byname() to simplify code

Cc: Peter Chen &lt;peter.chen@nxp.com&gt;
Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Chunfeng Yun &lt;chunfeng.yun@mediatek.com&gt;
Link: https://lore.kernel.org/r/1595404275-8449-3-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: drd: simplify *switch_gadet and *switch_host</title>
<updated>2020-07-24T13:45:13+00:00</updated>
<author>
<name>Pawel Laszczak</name>
<email>pawell@cadence.com</email>
</author>
<published>2020-07-13T10:05:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b2aeb6da3d6ee562e57ad3a7d73a7de0c36ce8eb'/>
<id>urn:sha1:b2aeb6da3d6ee562e57ad3a7d73a7de0c36ce8eb</id>
<content type='text'>
Patch split function cdns3_drd_switch_gadget and
cdns3_drd_switch_host into:
- cdns3_drd_host_on
- cdns3_drd_host_off
- cdns3_drd_gadget_on
- cdns3_drd_gadgett_off

These functions don't have any shared code so it's better to
have smaller, faster and easier functions.

Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: core: removed overwriting some error code</title>
<updated>2020-07-24T13:45:13+00:00</updated>
<author>
<name>Pawel Laszczak</name>
<email>pawell@cadence.com</email>
</author>
<published>2020-07-13T10:05:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f41ca26b8b178d0b7005c9bfeda88814179203b3'/>
<id>urn:sha1:f41ca26b8b178d0b7005c9bfeda88814179203b3</id>
<content type='text'>
Some error code can be preserved, so we can remove overwriting
error code returned by some functions.

Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: core: removed 'goto not_otg'</title>
<updated>2020-07-24T13:45:13+00:00</updated>
<author>
<name>Pawel Laszczak</name>
<email>pawell@cadence.com</email>
</author>
<published>2020-07-13T10:05:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5c2cf30f14cc3973f2d288e33b0153f5d9a357fb'/>
<id>urn:sha1:5c2cf30f14cc3973f2d288e33b0153f5d9a357fb</id>
<content type='text'>
Patch removes 'goto not_otg' instruction from
cdns3_hw_role_state_machine function.

Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: Added CDNS3_ID_PERIPHERAL and CDNS3_ID_HOST</title>
<updated>2020-07-24T13:45:13+00:00</updated>
<author>
<name>Pawel Laszczak</name>
<email>pawell@cadence.com</email>
</author>
<published>2020-07-13T10:05:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08c35dd3cc2184dcc952fc845329dcae1ee302d3'/>
<id>urn:sha1:08c35dd3cc2184dcc952fc845329dcae1ee302d3</id>
<content type='text'>
Patch adds 2 definitions that make it easier to understand the code.

Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
</feed>
