<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/usb, branch v5.4.76</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>usb: mtu3: fix panic in mtu3_gadget_stop()</title>
<updated>2020-11-10T11:37:33+00:00</updated>
<author>
<name>Macpaul Lin</name>
<email>macpaul.lin@mediatek.com</email>
</author>
<published>2020-11-06T05:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b9d91fa921642581ef749f4f6ee2b90f0dba9710'/>
<id>b9d91fa921642581ef749f4f6ee2b90f0dba9710</id>
<content type='text'>
commit 20914919ad31849ee2b9cfe0428f4a20335c9e2a upstream.

This patch fixes a possible issue when mtu3_gadget_stop()
already assigned NULL to mtu-&gt;gadget_driver during mtu_gadget_disconnect().

[&lt;ffffff9008161974&gt;] notifier_call_chain+0xa4/0x128
[&lt;ffffff9008161fd4&gt;] __atomic_notifier_call_chain+0x84/0x138
[&lt;ffffff9008162ec0&gt;] notify_die+0xb0/0x120
[&lt;ffffff900809e340&gt;] die+0x1f8/0x5d0
[&lt;ffffff90080d03b4&gt;] __do_kernel_fault+0x19c/0x280
[&lt;ffffff90080d04dc&gt;] do_bad_area+0x44/0x140
[&lt;ffffff90080d0f9c&gt;] do_translation_fault+0x4c/0x90
[&lt;ffffff9008080a78&gt;] do_mem_abort+0xb8/0x258
[&lt;ffffff90080849d0&gt;] el1_da+0x24/0x3c
[&lt;ffffff9009bde01c&gt;] mtu3_gadget_disconnect+0xac/0x128
[&lt;ffffff9009bd576c&gt;] mtu3_irq+0x34c/0xc18
[&lt;ffffff90082ac03c&gt;] __handle_irq_event_percpu+0x2ac/0xcd0
[&lt;ffffff90082acae0&gt;] handle_irq_event_percpu+0x80/0x138
[&lt;ffffff90082acc44&gt;] handle_irq_event+0xac/0x148
[&lt;ffffff90082b71cc&gt;] handle_fasteoi_irq+0x234/0x568
[&lt;ffffff90082a8708&gt;] generic_handle_irq+0x48/0x68
[&lt;ffffff90082a96ac&gt;] __handle_domain_irq+0x264/0x1740
[&lt;ffffff90080819f4&gt;] gic_handle_irq+0x14c/0x250
[&lt;ffffff9008084cec&gt;] el1_irq+0xec/0x194
[&lt;ffffff90085b985c&gt;] dma_pool_alloc+0x6e4/0xae0
[&lt;ffffff9008d7f890&gt;] cmdq_mbox_pool_alloc_impl+0xb0/0x238
[&lt;ffffff9008d80904&gt;] cmdq_pkt_alloc_buf+0x2dc/0x7c0
[&lt;ffffff9008d80f60&gt;] cmdq_pkt_add_cmd_buffer+0x178/0x270
[&lt;ffffff9008d82320&gt;] cmdq_pkt_perf_begin+0x108/0x148
[&lt;ffffff9008d824d8&gt;] cmdq_pkt_create+0x178/0x1f0
[&lt;ffffff9008f96230&gt;] mtk_crtc_config_default_path+0x328/0x7a0
[&lt;ffffff90090246cc&gt;] mtk_drm_idlemgr_kick+0xa6c/0x1460
[&lt;ffffff9008f9bbb4&gt;] mtk_drm_crtc_atomic_begin+0x1a4/0x1a68
[&lt;ffffff9008e8df9c&gt;] drm_atomic_helper_commit_planes+0x154/0x878
[&lt;ffffff9008f2fb70&gt;] mtk_atomic_complete.isra.16+0xe80/0x19c8
[&lt;ffffff9008f30910&gt;] mtk_atomic_commit+0x258/0x898
[&lt;ffffff9008ef142c&gt;] drm_atomic_commit+0xcc/0x108
[&lt;ffffff9008ef7cf0&gt;] drm_mode_atomic_ioctl+0x1c20/0x2580
[&lt;ffffff9008ebc768&gt;] drm_ioctl_kernel+0x118/0x1b0
[&lt;ffffff9008ebcde8&gt;] drm_ioctl+0x5c0/0x920
[&lt;ffffff900863b030&gt;] do_vfs_ioctl+0x188/0x1820
[&lt;ffffff900863c754&gt;] SyS_ioctl+0x8c/0xa0

Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver")
Signed-off-by: Macpaul Lin &lt;macpaul.lin@mediatek.com&gt;
Acked-by: Chunfeng Yun &lt;chunfeng.yun@mediatek.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1604642069-20961-1-git-send-email-macpaul.lin@mediatek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 20914919ad31849ee2b9cfe0428f4a20335c9e2a upstream.

This patch fixes a possible issue when mtu3_gadget_stop()
already assigned NULL to mtu-&gt;gadget_driver during mtu_gadget_disconnect().

[&lt;ffffff9008161974&gt;] notifier_call_chain+0xa4/0x128
[&lt;ffffff9008161fd4&gt;] __atomic_notifier_call_chain+0x84/0x138
[&lt;ffffff9008162ec0&gt;] notify_die+0xb0/0x120
[&lt;ffffff900809e340&gt;] die+0x1f8/0x5d0
[&lt;ffffff90080d03b4&gt;] __do_kernel_fault+0x19c/0x280
[&lt;ffffff90080d04dc&gt;] do_bad_area+0x44/0x140
[&lt;ffffff90080d0f9c&gt;] do_translation_fault+0x4c/0x90
[&lt;ffffff9008080a78&gt;] do_mem_abort+0xb8/0x258
[&lt;ffffff90080849d0&gt;] el1_da+0x24/0x3c
[&lt;ffffff9009bde01c&gt;] mtu3_gadget_disconnect+0xac/0x128
[&lt;ffffff9009bd576c&gt;] mtu3_irq+0x34c/0xc18
[&lt;ffffff90082ac03c&gt;] __handle_irq_event_percpu+0x2ac/0xcd0
[&lt;ffffff90082acae0&gt;] handle_irq_event_percpu+0x80/0x138
[&lt;ffffff90082acc44&gt;] handle_irq_event+0xac/0x148
[&lt;ffffff90082b71cc&gt;] handle_fasteoi_irq+0x234/0x568
[&lt;ffffff90082a8708&gt;] generic_handle_irq+0x48/0x68
[&lt;ffffff90082a96ac&gt;] __handle_domain_irq+0x264/0x1740
[&lt;ffffff90080819f4&gt;] gic_handle_irq+0x14c/0x250
[&lt;ffffff9008084cec&gt;] el1_irq+0xec/0x194
[&lt;ffffff90085b985c&gt;] dma_pool_alloc+0x6e4/0xae0
[&lt;ffffff9008d7f890&gt;] cmdq_mbox_pool_alloc_impl+0xb0/0x238
[&lt;ffffff9008d80904&gt;] cmdq_pkt_alloc_buf+0x2dc/0x7c0
[&lt;ffffff9008d80f60&gt;] cmdq_pkt_add_cmd_buffer+0x178/0x270
[&lt;ffffff9008d82320&gt;] cmdq_pkt_perf_begin+0x108/0x148
[&lt;ffffff9008d824d8&gt;] cmdq_pkt_create+0x178/0x1f0
[&lt;ffffff9008f96230&gt;] mtk_crtc_config_default_path+0x328/0x7a0
[&lt;ffffff90090246cc&gt;] mtk_drm_idlemgr_kick+0xa6c/0x1460
[&lt;ffffff9008f9bbb4&gt;] mtk_drm_crtc_atomic_begin+0x1a4/0x1a68
[&lt;ffffff9008e8df9c&gt;] drm_atomic_helper_commit_planes+0x154/0x878
[&lt;ffffff9008f2fb70&gt;] mtk_atomic_complete.isra.16+0xe80/0x19c8
[&lt;ffffff9008f30910&gt;] mtk_atomic_commit+0x258/0x898
[&lt;ffffff9008ef142c&gt;] drm_atomic_commit+0xcc/0x108
[&lt;ffffff9008ef7cf0&gt;] drm_mode_atomic_ioctl+0x1c20/0x2580
[&lt;ffffff9008ebc768&gt;] drm_ioctl_kernel+0x118/0x1b0
[&lt;ffffff9008ebcde8&gt;] drm_ioctl+0x5c0/0x920
[&lt;ffffff900863b030&gt;] do_vfs_ioctl+0x188/0x1820
[&lt;ffffff900863c754&gt;] SyS_ioctl+0x8c/0xa0

Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver")
Signed-off-by: Macpaul Lin &lt;macpaul.lin@mediatek.com&gt;
Acked-by: Chunfeng Yun &lt;chunfeng.yun@mediatek.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1604642069-20961-1-git-send-email-macpaul.lin@mediatek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: Add NO_LPM quirk for Kingston flash drive</title>
<updated>2020-11-10T11:37:33+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2020-11-02T14:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b0d03a1bdb3cd35d483eea25f860b688f906ffb1'/>
<id>b0d03a1bdb3cd35d483eea25f860b688f906ffb1</id>
<content type='text'>
commit afaa2e745a246c5ab95103a65b1ed00101e1bc63 upstream.

In Bugzilla #208257, Julien Humbert reports that a 32-GB Kingston
flash drive spontaneously disconnects and reconnects, over and over.
Testing revealed that disabling Link Power Management for the drive
fixed the problem.

This patch adds a quirk entry for that drive to turn off LPM permanently.

CC: Hans de Goede &lt;jwrdegoede@fedoraproject.org&gt;
CC: &lt;stable@vger.kernel.org&gt;
Reported-and-tested-by: Julien Humbert &lt;julroy67@gmail.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20201102145821.GA1478741@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit afaa2e745a246c5ab95103a65b1ed00101e1bc63 upstream.

In Bugzilla #208257, Julien Humbert reports that a 32-GB Kingston
flash drive spontaneously disconnects and reconnects, over and over.
Testing revealed that disabling Link Power Management for the drive
fixed the problem.

This patch adds a quirk entry for that drive to turn off LPM permanently.

CC: Hans de Goede &lt;jwrdegoede@fedoraproject.org&gt;
CC: &lt;stable@vger.kernel.org&gt;
Reported-and-tested-by: Julien Humbert &lt;julroy67@gmail.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20201102145821.GA1478741@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: ep0: Fix delay status handling</title>
<updated>2020-11-10T11:37:33+00:00</updated>
<author>
<name>Thinh Nguyen</name>
<email>Thinh.Nguyen@synopsys.com</email>
</author>
<published>2020-10-22T22:44:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=290fcf3e0c0c825cf89101f4b2c0c2d9717f0ca8'/>
<id>290fcf3e0c0c825cf89101f4b2c0c2d9717f0ca8</id>
<content type='text'>
commit fa27e2f6c5e674f3f1225f9ca7a7821faaf393bb upstream.

If we want to send a control status on our own time (through
delayed_status), make sure to handle a case where we may queue the
delayed status before the host requesting for it (when XferNotReady
is generated). Otherwise, the driver won't send anything because it's
not EP0_STATUS_PHASE yet. To resolve this, regardless whether
dwc-&gt;ep0state is EP0_STATUS_PHASE, make sure to clear the
dwc-&gt;delayed_status flag if dwc3_ep0_send_delayed_status() is called.
The control status can be sent when the host requests it later.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: d97c78a1908e ("usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command")
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fa27e2f6c5e674f3f1225f9ca7a7821faaf393bb upstream.

If we want to send a control status on our own time (through
delayed_status), make sure to handle a case where we may queue the
delayed status before the host requesting for it (when XferNotReady
is generated). Otherwise, the driver won't send anything because it's
not EP0_STATUS_PHASE yet. To resolve this, regardless whether
dwc-&gt;ep0state is EP0_STATUS_PHASE, make sure to clear the
dwc-&gt;delayed_status flag if dwc3_ep0_send_delayed_status() is called.
The control status can be sent when the host requests it later.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: d97c78a1908e ("usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command")
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: serial: option: add Telit FN980 composition 0x1055</title>
<updated>2020-11-10T11:37:33+00:00</updated>
<author>
<name>Daniele Palmas</name>
<email>dnlplm@gmail.com</email>
</author>
<published>2020-11-03T12:44:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d5d3cca9d61f518e3c031fb7908291e76d7e4a1f'/>
<id>d5d3cca9d61f518e3c031fb7908291e76d7e4a1f</id>
<content type='text'>
commit db0362eeb22992502764e825c79b922d7467e0eb upstream.

Add the following Telit FN980 composition:

0x1055: tty, adb, tty, tty, tty, tty

Signed-off-by: Daniele Palmas &lt;dnlplm@gmail.com&gt;
Link: https://lore.kernel.org/r/20201103124425.12940-1-dnlplm@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit db0362eeb22992502764e825c79b922d7467e0eb upstream.

Add the following Telit FN980 composition:

0x1055: tty, adb, tty, tty, tty, tty

Signed-off-by: Daniele Palmas &lt;dnlplm@gmail.com&gt;
Link: https://lore.kernel.org/r/20201103124425.12940-1-dnlplm@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231</title>
<updated>2020-11-10T11:37:32+00:00</updated>
<author>
<name>Daniele Palmas</name>
<email>dnlplm@gmail.com</email>
</author>
<published>2020-10-31T22:54:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7f7be9341b860608d20acaa4e1402e316b000e91'/>
<id>7f7be9341b860608d20acaa4e1402e316b000e91</id>
<content type='text'>
commit 489979b4aab490b6b917c11dc02d81b4b742784a upstream.

Add following Telit LE910Cx compositions:

0x1203: rndis, tty, adb, tty, tty, tty, tty
0x1230: tty, adb, rmnet, audio, tty, tty, tty, tty
0x1231: rndis, tty, adb, audio, tty, tty, tty, tty

Signed-off-by: Daniele Palmas &lt;dnlplm@gmail.com&gt;
Link: https://lore.kernel.org/r/20201031225458.10512-1-dnlplm@gmail.com
[ johan: add comments after entries ]
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 489979b4aab490b6b917c11dc02d81b4b742784a upstream.

Add following Telit LE910Cx compositions:

0x1203: rndis, tty, adb, tty, tty, tty, tty
0x1230: tty, adb, rmnet, audio, tty, tty, tty, tty
0x1231: rndis, tty, adb, audio, tty, tty, tty, tty

Signed-off-by: Daniele Palmas &lt;dnlplm@gmail.com&gt;
Link: https://lore.kernel.org/r/20201031225458.10512-1-dnlplm@gmail.com
[ johan: add comments after entries ]
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: serial: option: add Quectel EC200T module support</title>
<updated>2020-11-10T11:37:32+00:00</updated>
<author>
<name>Ziyi Cao</name>
<email>kernel@septs.pw</email>
</author>
<published>2020-10-19T16:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b7f74775c2bb7037b811cf531235acf1ecacd4fb'/>
<id>b7f74775c2bb7037b811cf531235acf1ecacd4fb</id>
<content type='text'>
commit a46b973bced1ba57420752bf38426acd9f6cbfa6 upstream.

Add usb product id of the Quectel EC200T module.

Signed-off-by: Ziyi Cao &lt;kernel@septs.pw&gt;
Link: https://lore.kernel.org/r/17f8a2a3-ce0f-4be7-8544-8fdf286907d0@www.fastmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a46b973bced1ba57420752bf38426acd9f6cbfa6 upstream.

Add usb product id of the Quectel EC200T module.

Signed-off-by: Ziyi Cao &lt;kernel@septs.pw&gt;
Link: https://lore.kernel.org/r/17f8a2a3-ce0f-4be7-8544-8fdf286907d0@www.fastmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: serial: cyberjack: fix write-URB completion race</title>
<updated>2020-11-10T11:37:32+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2020-10-26T08:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9d34dbab6ef4cd3494b8127d8883100f67e0e4a9'/>
<id>9d34dbab6ef4cd3494b8127d8883100f67e0e4a9</id>
<content type='text'>
commit 985616f0457d9f555fff417d0da56174f70cc14f upstream.

The write-URB busy flag was being cleared before the completion handler
was done with the URB, something which could lead to corrupt transfers
due to a racing write request if the URB is resubmitted.

Fixes: 507ca9bc0476 ("[PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 2.6.13
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 985616f0457d9f555fff417d0da56174f70cc14f upstream.

The write-URB busy flag was being cleared before the completion handler
was done with the URB, something which could lead to corrupt transfers
due to a racing write request if the URB is resubmitted.

Fixes: 507ca9bc0476 ("[PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 2.6.13
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: cdns3: gadget: suspicious implicit sign extension</title>
<updated>2020-11-10T11:37:31+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.tavy.me/linux-stable.git/commit/?id=4dab0fd40323f55c94c2377cf29aaac1b4408176'/>
<id>4dab0fd40323f55c94c2377cf29aaac1b4408176</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: host: fsl-mph-dr-of: check return of dma_set_mask()</title>
<updated>2020-11-05T10:43:29+00:00</updated>
<author>
<name>Ran Wang</name>
<email>ran.wang_1@nxp.com</email>
</author>
<published>2020-10-10T06:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=94478c1dc57d88413c7927a303522eafad83c1dc'/>
<id>94478c1dc57d88413c7927a303522eafad83c1dc</id>
<content type='text'>
commit 3cd54a618834430a26a648d880dd83d740f2ae30 upstream.

fsl_usb2_device_register() should stop init if dma_set_mask() return
error.

Fixes: cae058610465 ("drivers/usb/host: fsl: Set DMA_MASK of usb platform device")
Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Ran Wang &lt;ran.wang_1@nxp.com&gt;
Link: https://lore.kernel.org/r/20201010060308.33693-1-ran.wang_1@nxp.com
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3cd54a618834430a26a648d880dd83d740f2ae30 upstream.

fsl_usb2_device_register() should stop init if dma_set_mask() return
error.

Fixes: cae058610465 ("drivers/usb/host: fsl: Set DMA_MASK of usb platform device")
Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Ran Wang &lt;ran.wang_1@nxp.com&gt;
Link: https://lore.kernel.org/r/20201010060308.33693-1-ran.wang_1@nxp.com
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: typec: tcpm: reset hard_reset_count for any disconnect</title>
<updated>2020-11-05T10:43:28+00:00</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2020-10-12T11:03:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=75d0d4ff5970e613d636cf9448cd9fbd18826306'/>
<id>75d0d4ff5970e613d636cf9448cd9fbd18826306</id>
<content type='text'>
commit 2d9c6442a9c81f4f8dee678d0b3c183173ab1e2d upstream.

Current tcpm_detach() only reset hard_reset_count if port-&gt;attached
is true, this may cause this counter clear is missed if the CC
disconnect event is generated after tcpm_port_reset() is done
by other events, e.g. VBUS off comes first before CC disconect for
a power sink, in that case the first tcpm_detach() will only clear
port-&gt;attached flag but leave hard_reset_count there because
tcpm_port_is_disconnected() is still false, then later tcpm_detach()
by CC disconnect will directly return due to port-&gt;attached is cleared,
finally this will result tcpm will not try hard reset or error recovery
for later attach.

ChiYuan reported this issue on his platform with below tcpm trace:
After power sink session setup after hard reset 2 times, detach
from the power source and then attach:
[ 4848.046358] VBUS off
[ 4848.046384] state change SNK_READY -&gt; SNK_UNATTACHED
[ 4848.050908] Setting voltage/current limit 0 mV 0 mA
[ 4848.050936] polarity 0
[ 4848.052593] Requesting mux state 0, usb-role 0, orientation 0
[ 4848.053222] Start toggling
[ 4848.086500] state change SNK_UNATTACHED -&gt; TOGGLING
[ 4848.089983] CC1: 0 -&gt; 0, CC2: 3 -&gt; 3 [state TOGGLING, polarity 0, connected]
[ 4848.089993] state change TOGGLING -&gt; SNK_ATTACH_WAIT
[ 4848.090031] pending state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED @200 ms
[ 4848.141162] CC1: 0 -&gt; 0, CC2: 3 -&gt; 0 [state SNK_ATTACH_WAIT, polarity 0, disconnected]
[ 4848.141170] state change SNK_ATTACH_WAIT -&gt; SNK_ATTACH_WAIT
[ 4848.141184] pending state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED @20 ms
[ 4848.163156] state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED [delayed 20 ms]
[ 4848.163162] Start toggling
[ 4848.216918] CC1: 0 -&gt; 0, CC2: 0 -&gt; 3 [state TOGGLING, polarity 0, connected]
[ 4848.216954] state change TOGGLING -&gt; SNK_ATTACH_WAIT
[ 4848.217080] pending state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED @200 ms
[ 4848.231771] CC1: 0 -&gt; 0, CC2: 3 -&gt; 0 [state SNK_ATTACH_WAIT, polarity 0, disconnected]
[ 4848.231800] state change SNK_ATTACH_WAIT -&gt; SNK_ATTACH_WAIT
[ 4848.231857] pending state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED @20 ms
[ 4848.256022] state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED [delayed20 ms]
[ 4848.256049] Start toggling
[ 4848.871148] VBUS on
[ 4848.885324] CC1: 0 -&gt; 0, CC2: 0 -&gt; 3 [state TOGGLING, polarity 0, connected]
[ 4848.885372] state change TOGGLING -&gt; SNK_ATTACH_WAIT
[ 4848.885548] pending state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED @200 ms
[ 4849.088240] state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED [delayed200 ms]
[ 4849.088284] state change SNK_DEBOUNCED -&gt; SNK_ATTACHED
[ 4849.088291] polarity 1
[ 4849.088769] Requesting mux state 1, usb-role 2, orientation 2
[ 4849.088895] state change SNK_ATTACHED -&gt; SNK_STARTUP
[ 4849.088907] state change SNK_STARTUP -&gt; SNK_DISCOVERY
[ 4849.088915] Setting voltage/current limit 5000 mV 0 mA
[ 4849.088927] vbus=0 charge:=1
[ 4849.090505] state change SNK_DISCOVERY -&gt; SNK_WAIT_CAPABILITIES
[ 4849.090828] pending state change SNK_WAIT_CAPABILITIES -&gt; SNK_READY @240 ms
[ 4849.335878] state change SNK_WAIT_CAPABILITIES -&gt; SNK_READY [delayed240 ms]

this patch fix this issue by clear hard_reset_count at any cases
of cc disconnect, í.e. don't check port-&gt;attached flag.

Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
Cc: stable@vger.kernel.org
Reported-and-tested-by: ChiYuan Huang &lt;cy_huang@richtek.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Link: https://lore.kernel.org/r/1602500592-3817-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2d9c6442a9c81f4f8dee678d0b3c183173ab1e2d upstream.

Current tcpm_detach() only reset hard_reset_count if port-&gt;attached
is true, this may cause this counter clear is missed if the CC
disconnect event is generated after tcpm_port_reset() is done
by other events, e.g. VBUS off comes first before CC disconect for
a power sink, in that case the first tcpm_detach() will only clear
port-&gt;attached flag but leave hard_reset_count there because
tcpm_port_is_disconnected() is still false, then later tcpm_detach()
by CC disconnect will directly return due to port-&gt;attached is cleared,
finally this will result tcpm will not try hard reset or error recovery
for later attach.

ChiYuan reported this issue on his platform with below tcpm trace:
After power sink session setup after hard reset 2 times, detach
from the power source and then attach:
[ 4848.046358] VBUS off
[ 4848.046384] state change SNK_READY -&gt; SNK_UNATTACHED
[ 4848.050908] Setting voltage/current limit 0 mV 0 mA
[ 4848.050936] polarity 0
[ 4848.052593] Requesting mux state 0, usb-role 0, orientation 0
[ 4848.053222] Start toggling
[ 4848.086500] state change SNK_UNATTACHED -&gt; TOGGLING
[ 4848.089983] CC1: 0 -&gt; 0, CC2: 3 -&gt; 3 [state TOGGLING, polarity 0, connected]
[ 4848.089993] state change TOGGLING -&gt; SNK_ATTACH_WAIT
[ 4848.090031] pending state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED @200 ms
[ 4848.141162] CC1: 0 -&gt; 0, CC2: 3 -&gt; 0 [state SNK_ATTACH_WAIT, polarity 0, disconnected]
[ 4848.141170] state change SNK_ATTACH_WAIT -&gt; SNK_ATTACH_WAIT
[ 4848.141184] pending state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED @20 ms
[ 4848.163156] state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED [delayed 20 ms]
[ 4848.163162] Start toggling
[ 4848.216918] CC1: 0 -&gt; 0, CC2: 0 -&gt; 3 [state TOGGLING, polarity 0, connected]
[ 4848.216954] state change TOGGLING -&gt; SNK_ATTACH_WAIT
[ 4848.217080] pending state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED @200 ms
[ 4848.231771] CC1: 0 -&gt; 0, CC2: 3 -&gt; 0 [state SNK_ATTACH_WAIT, polarity 0, disconnected]
[ 4848.231800] state change SNK_ATTACH_WAIT -&gt; SNK_ATTACH_WAIT
[ 4848.231857] pending state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED @20 ms
[ 4848.256022] state change SNK_ATTACH_WAIT -&gt; SNK_UNATTACHED [delayed20 ms]
[ 4848.256049] Start toggling
[ 4848.871148] VBUS on
[ 4848.885324] CC1: 0 -&gt; 0, CC2: 0 -&gt; 3 [state TOGGLING, polarity 0, connected]
[ 4848.885372] state change TOGGLING -&gt; SNK_ATTACH_WAIT
[ 4848.885548] pending state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED @200 ms
[ 4849.088240] state change SNK_ATTACH_WAIT -&gt; SNK_DEBOUNCED [delayed200 ms]
[ 4849.088284] state change SNK_DEBOUNCED -&gt; SNK_ATTACHED
[ 4849.088291] polarity 1
[ 4849.088769] Requesting mux state 1, usb-role 2, orientation 2
[ 4849.088895] state change SNK_ATTACHED -&gt; SNK_STARTUP
[ 4849.088907] state change SNK_STARTUP -&gt; SNK_DISCOVERY
[ 4849.088915] Setting voltage/current limit 5000 mV 0 mA
[ 4849.088927] vbus=0 charge:=1
[ 4849.090505] state change SNK_DISCOVERY -&gt; SNK_WAIT_CAPABILITIES
[ 4849.090828] pending state change SNK_WAIT_CAPABILITIES -&gt; SNK_READY @240 ms
[ 4849.335878] state change SNK_WAIT_CAPABILITIES -&gt; SNK_READY [delayed240 ms]

this patch fix this issue by clear hard_reset_count at any cases
of cc disconnect, í.e. don't check port-&gt;attached flag.

Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
Cc: stable@vger.kernel.org
Reported-and-tested-by: ChiYuan Huang &lt;cy_huang@richtek.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Link: https://lore.kernel.org/r/1602500592-3817-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
