Hi Sasha,
i was OOO last week.
Let me check why the patch doesn't apply in the older kernel series.
I originally developed it on a 4.14.86 and ported it to 5.1.
Shouldn't be a big problem, its a "one line mover" only.
BR
Carsten
> -----Ursprüngliche Nachricht-----
> Von: Sasha Levin [mailto:sashal@kernel.org]
> Gesendet: Mittwoch, 29. Mai 2019 15:15
> An: Sasha Levin <sashal(a)kernel.org>; Mathias Nyman
> <mathias.nyman(a)linux.intel.com>; Schmid, Carsten
> <Carsten_Schmid(a)mentor.com>; gregkh(a)linuxfoundation.org
> Cc: linux-usb(a)vger.kernel.org; Stable <stable(a)vger.kernel.org>;
> stable(a)vger.kernel.org
> Betreff: Re: [PATCH 3/5] usb: xhci: avoid null pointer deref when bos field is
> NULL
>
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v5.1.4, v5.0.18, v4.19.45, v4.14.121,
> v4.9.178, v4.4.180, v3.18.140.
>
> v5.1.4: Build OK!
> v5.0.18: Build OK!
> v4.19.45: Build OK!
> v4.14.121: Failed to apply! Possible dependencies:
> 01451ad47e272 ("powerpc/powermac: Use setup_timer() helper")
> 38986ffa6a748 ("xhci: use port structures instead of port arrays in xhci.c
> functions")
> 83ad1e6a1dc04 ("powerpc/oprofile: Use setup_timer() helper")
> 8d6b1bf20f61c ("powerpc/6xx: Use setup_timer() helper")
> b1fc2839d2f92 ("drm/msm: Implement preemption for A5XX targets")
> b9eaf18722221 ("treewide: init_timer() -> setup_timer()")
> cd414f3d93168 ("drm/msm: Move memptrs to msm_gpu")
> e629cfa36ea08 ("MIPS: Lasat: Use setup_timer() helper")
> e99e88a9d2b06 ("treewide: setup_timer() -> timer_setup()")
> eec874ce5ff1f ("drm/msm/adreno: load gpu at probe/bind time")
> f7de15450e906 ("drm/msm: Add per-instance submit queues")
> f97decac5f4c2 ("drm/msm: Support multiple ringbuffers")
>
> v4.9.178: Failed to apply! Possible dependencies:
> 01451ad47e272 ("powerpc/powermac: Use setup_timer() helper")
> 38986ffa6a748 ("xhci: use port structures instead of port arrays in xhci.c
> functions")
> 53460c53b7619 ("[media] au0828: Add timer to restart TS stream if no data
> arrives on bulk endpoint")
> 7c96f59e0cafe ("[media] s5p-mfc: Fix initialization of internal structures")
> 83ad1e6a1dc04 ("powerpc/oprofile: Use setup_timer() helper")
> 8d6b1bf20f61c ("powerpc/6xx: Use setup_timer() helper")
> b9eaf18722221 ("treewide: init_timer() -> setup_timer()")
> cf43e6be865a5 ("block: add scalable completion tracking of requests")
> e629cfa36ea08 ("MIPS: Lasat: Use setup_timer() helper")
> e806402130c9c ("block: split out request-only flags into a new namespace")
> e99e88a9d2b06 ("treewide: setup_timer() -> timer_setup()")
>
> v4.4.180: Failed to apply! Possible dependencies:
> 01451ad47e272 ("powerpc/powermac: Use setup_timer() helper")
> 37f895d7e85e7 ("NFC: pn533: Fix socket deadlock")
> 38986ffa6a748 ("xhci: use port structures instead of port arrays in xhci.c
> functions")
> 53460c53b7619 ("[media] au0828: Add timer to restart TS stream if no data
> arrives on bulk endpoint")
> 7c96f59e0cafe ("[media] s5p-mfc: Fix initialization of internal structures")
> 80c1bce9aa315 ("[media] au0828: Refactoring for start_urb_transfer()")
> 83ad1e6a1dc04 ("powerpc/oprofile: Use setup_timer() helper")
> 8d6b1bf20f61c ("powerpc/6xx: Use setup_timer() helper")
> 9815c7cf22dac ("NFC: pn533: Separate physical layer from the core
> implementation")
> b9eaf18722221 ("treewide: init_timer() -> setup_timer()")
> e629cfa36ea08 ("MIPS: Lasat: Use setup_timer() helper")
> e997ebbe46fe4 ("NFC: pn533: Send ATR_REQ only if
> NFC_PROTO_NFC_DEP bit is set")
> e99e88a9d2b06 ("treewide: setup_timer() -> timer_setup()")
>
> v3.18.140: Failed to apply! Possible dependencies:
> 0a5942c8e1480 ("NFC: Add ACPI support for NXP PN544")
> 34ac49664149d ("NFC: nci: remove current SLEEP mode management")
> 3590ebc040c9e ("NFC: logging neatening")
> 3682f49f32051 ("NFC: netlink: Add new netlink command
> NFC_CMD_ACTIVATE_TARGET")
> 37f895d7e85e7 ("NFC: pn533: Fix socket deadlock")
> 38986ffa6a748 ("xhci: use port structures instead of port arrays in xhci.c
> functions")
> 53460c53b7619 ("[media] au0828: Add timer to restart TS stream if no data
> arrives on bulk endpoint")
> 5df848f37b1d2 ("NFC: pn533: fix error return code")
> 7c96f59e0cafe ("[media] s5p-mfc: Fix initialization of internal structures")
> 80c1bce9aa315 ("[media] au0828: Refactoring for start_urb_transfer()")
> 9295b5b569fc4 ("NFC: nci: Add support for different
> NCI_DEACTIVATE_TYPE")
> 96d4581f0b371 ("NFC: netlink: Add mode parameter to deactivate_target
> functions")
> 9815c7cf22dac ("NFC: pn533: Separate physical layer from the core
> implementation")
> b9eaf18722221 ("treewide: init_timer() -> setup_timer()")
> d7979e130ebb0 ("NFC: NCI: Signal deactivation in Target mode")
> e997ebbe46fe4 ("NFC: pn533: Send ATR_REQ only if
> NFC_PROTO_NFC_DEP bit is set")
> e99e88a9d2b06 ("treewide: setup_timer() -> timer_setup()")
>
>
> How should we proceed with this patch?
>
> --
> Thanks,
> Sasha
An endpoint conflict occurs when the USB is working in device mode
during an isochronous communication. When the endpointA IN direction
is an isochronous IN endpoint, and the host sends an IN token to
endpointA on another device, then the OUT transaction may be missed
regardless the OUT endpoint number. Generally, this occurs when the
device is connected to the host through a hub and other devices are
connected to the same hub.
The affected OUT endpoint can be either control, bulk, isochronous, or
an interrupt endpoint. After the OUT endpoint is primed, if an IN token
to the same endpoint number on another device is received, then the OUT
endpoint may be unprimed (cannot be detected by software), which causes
this endpoint to no longer respond to the host OUT token, and thus, no
corresponding interrupt occurs.
There is no good workaround for this issue, the only thing the software
could do is numbering isochronous IN from the highest endpoint since we
have observed most of device number endpoint from the lowest.
Cc: <stable(a)vger.kernel.org> #v3.14+
Cc: Fabio Estevam <festevam(a)gmail.com>
Cc: Greg KH <gregkh(a)linuxfoundation.org>
Cc: Sergei Shtylyov <sergei.shtylyov(a)cogentembedded.com>
Cc: Jun Li <jun.li(a)nxp.com>
Signed-off-by: Peter Chen <peter.chen(a)nxp.com>
---
Changes for v3:
- Using MACRO to simply the code
- One tiny code style issue
Changes for v2:
- Improve the code sytle
drivers/usb/chipidea/udc.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 829e947cabf5..6a5ee8e6da10 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1622,6 +1622,25 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
static int ci_udc_start(struct usb_gadget *gadget,
struct usb_gadget_driver *driver);
static int ci_udc_stop(struct usb_gadget *gadget);
+
+/* Match ISOC IN from the highest endpoint */
+static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget,
+ struct usb_endpoint_descriptor *desc,
+ struct usb_ss_ep_comp_descriptor *comp_desc)
+{
+ struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
+ struct usb_ep *ep;
+
+ if (usb_endpoint_xfer_isoc(desc) && usb_endpoint_dir_in(desc)) {
+ list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
+ if (ep->caps.dir_in && !ep->claimed)
+ return ep;
+ }
+ }
+
+ return NULL;
+}
+
/**
* Device operations part of the API to the USB controller hardware,
* which don't involve endpoints (or i/o)
@@ -1635,6 +1654,7 @@ static const struct usb_gadget_ops usb_gadget_ops = {
.vbus_draw = ci_udc_vbus_draw,
.udc_start = ci_udc_start,
.udc_stop = ci_udc_stop,
+ .match_ep = ci_udc_match_ep,
};
static int init_eps(struct ci_hdrc *ci)
--
2.14.1
On 2019/5/31 22:37, Tejun Heo wrote:
> On Fri, May 31, 2019 at 04:29:12PM +0800, Gao Xiang wrote:
>> non-inline io_schedule() was introduced in
>> commit 10ab56434f2f ("sched/core: Separate out io_schedule_prepare() and io_schedule_finish()")
>> Keep in line with io_schedule_timeout, Otherwise
>> "/proc/<pid>/wchan" will report io_schedule()
>> rather than its callers when waiting io.
>>
>> Reported-by: Jilong Kou <koujilong(a)huawei.com>
>> Cc: Tejun Heo <tj(a)kernel.org>
>> Cc: Ingo Molnar <mingo(a)redhat.com>
>> Cc: Peter Zijlstra <peterz(a)infradead.org>
>> Signed-off-by: Gao Xiang <gaoxiang25(a)huawei.com>
>
> Acked-by: Tejun Heo <tj(a)kernel.org>
Cc: <stable(a)vger.kernel.org> # 4.11+
Thanks Tejun. This patch will be needed for io performance analysis
since we found that Android systrace tool cannot show the callers of
iowait raised from io_schedule() on linux-4.14 LTS kernel.
Hi Andrew, could you kindly take this patch?
Thanks,
Gao Xiang
>
> Thanks.
>