From: Sasha Levin Date: Mon, 25 May 2020 20:56:03 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v4.4.225~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=842450c1f65d7eb3e350d70e90b1d35f7daeb85c;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch b/queue-4.19/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch new file mode 100644 index 00000000000..ba84690dc97 --- /dev/null +++ b/queue-4.19/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch @@ -0,0 +1,68 @@ +From 86fceaa3082f3d5fbc25b6d207a38f86b2daba66 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 30 Apr 2020 11:28:45 +0200 +Subject: iio: adc: stm32-adc: fix device used to request dma + +From: Fabrice Gasnier + +[ Upstream commit 52cd91c27f3908b88e8b25aed4a4d20660abcc45 ] + +DMA channel request should use device struct from platform device struct. +Currently it's using iio device struct. But at this stage when probing, +device struct isn't yet registered (e.g. device_register is done in +iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create +symlinks between DMA channels and slaves"), a warning message is printed +as the links in sysfs can't be created, due to device isn't yet registered: +- Cannot create DMA slave symlink +- Cannot create DMA dma:rx symlink + +Fix this by using device struct from platform device to request dma chan. + +Fixes: 2763ea0585c99 ("iio: adc: stm32: add optional dma support") + +Signed-off-by: Fabrice Gasnier +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/adc/stm32-adc.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c +index d85caedda02e..59fd8b620c50 100644 +--- a/drivers/iio/adc/stm32-adc.c ++++ b/drivers/iio/adc/stm32-adc.c +@@ -1682,18 +1682,18 @@ static int stm32_adc_chan_of_init(struct iio_dev *indio_dev) + return 0; + } + +-static int stm32_adc_dma_request(struct iio_dev *indio_dev) ++static int stm32_adc_dma_request(struct device *dev, struct iio_dev *indio_dev) + { + struct stm32_adc *adc = iio_priv(indio_dev); + struct dma_slave_config config; + int ret; + +- adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); ++ adc->dma_chan = dma_request_chan(dev, "rx"); + if (IS_ERR(adc->dma_chan)) { + ret = PTR_ERR(adc->dma_chan); + if (ret != -ENODEV) { + if (ret != -EPROBE_DEFER) +- dev_err(&indio_dev->dev, ++ dev_err(dev, + "DMA channel request failed with %d\n", + ret); + return ret; +@@ -1816,7 +1816,7 @@ static int stm32_adc_probe(struct platform_device *pdev) + if (ret < 0) + goto err_clk_disable; + +- ret = stm32_adc_dma_request(indio_dev); ++ ret = stm32_adc_dma_request(dev, indio_dev); + if (ret < 0) + goto err_clk_disable; + +-- +2.25.1 + diff --git a/queue-4.19/iio-adc-stm32-adc-use-dma_request_chan-instead-dma_r.patch b/queue-4.19/iio-adc-stm32-adc-use-dma_request_chan-instead-dma_r.patch new file mode 100644 index 00000000000..7127ab33293 --- /dev/null +++ b/queue-4.19/iio-adc-stm32-adc-use-dma_request_chan-instead-dma_r.patch @@ -0,0 +1,55 @@ +From 53179355832e69773eb527ea0b1f2a4aa1a07675 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Jan 2020 10:08:01 +0200 +Subject: iio: adc: stm32-adc: Use dma_request_chan() instead + dma_request_slave_channel() + +From: Peter Ujfalusi + +[ Upstream commit 735404b846dffcb320264f62b76e6f70012214dd ] + +dma_request_slave_channel() is a wrapper on top of dma_request_chan() +eating up the error code. + +By using dma_request_chan() directly the driver can support deferred +probing against DMA. + +Signed-off-by: Peter Ujfalusi +Acked-by: Fabrice Gasnier +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/adc/stm32-adc.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c +index 24d5d049567a..d85caedda02e 100644 +--- a/drivers/iio/adc/stm32-adc.c ++++ b/drivers/iio/adc/stm32-adc.c +@@ -1688,9 +1688,21 @@ static int stm32_adc_dma_request(struct iio_dev *indio_dev) + struct dma_slave_config config; + int ret; + +- adc->dma_chan = dma_request_slave_channel(&indio_dev->dev, "rx"); +- if (!adc->dma_chan) ++ adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); ++ if (IS_ERR(adc->dma_chan)) { ++ ret = PTR_ERR(adc->dma_chan); ++ if (ret != -ENODEV) { ++ if (ret != -EPROBE_DEFER) ++ dev_err(&indio_dev->dev, ++ "DMA channel request failed with %d\n", ++ ret); ++ return ret; ++ } ++ ++ /* DMA is optional: fall back to IRQ mode */ ++ adc->dma_chan = NULL; + return 0; ++ } + + adc->rx_buf = dma_alloc_coherent(adc->dma_chan->device->dev, + STM32_DMA_BUFFER_SIZE, +-- +2.25.1 + diff --git a/queue-4.19/iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch b/queue-4.19/iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch new file mode 100644 index 00000000000..c6bbe1b9ce1 --- /dev/null +++ b/queue-4.19/iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch @@ -0,0 +1,96 @@ +From e107dec34cf322b9236d66687456babd4983ea81 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 30 Apr 2020 11:28:46 +0200 +Subject: iio: adc: stm32-dfsdm: fix device used to request dma + +From: Fabrice Gasnier + +[ Upstream commit b455d06e6fb3c035711e8aab1ca18082ccb15d87 ] + +DMA channel request should use device struct from platform device struct. +Currently it's using iio device struct. But at this stage when probing, +device struct isn't yet registered (e.g. device_register is done in +iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create +symlinks between DMA channels and slaves"), a warning message is printed +as the links in sysfs can't be created, due to device isn't yet registered: +- Cannot create DMA slave symlink +- Cannot create DMA dma:rx symlink + +Fix this by using device struct from platform device to request dma chan. + +Fixes: eca949800d2d ("IIO: ADC: add stm32 DFSDM support for PDM microphone") + +Signed-off-by: Fabrice Gasnier +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/adc/stm32-dfsdm-adc.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c +index 516d7d22d9f4..1c492a7f4587 100644 +--- a/drivers/iio/adc/stm32-dfsdm-adc.c ++++ b/drivers/iio/adc/stm32-dfsdm-adc.c +@@ -45,7 +45,7 @@ enum sd_converter_type { + + struct stm32_dfsdm_dev_data { + int type; +- int (*init)(struct iio_dev *indio_dev); ++ int (*init)(struct device *dev, struct iio_dev *indio_dev); + unsigned int num_channels; + const struct regmap_config *regmap_cfg; + }; +@@ -923,7 +923,8 @@ static void stm32_dfsdm_dma_release(struct iio_dev *indio_dev) + } + } + +-static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev) ++static int stm32_dfsdm_dma_request(struct device *dev, ++ struct iio_dev *indio_dev) + { + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); + struct dma_slave_config config = { +@@ -933,7 +934,7 @@ static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev) + }; + int ret; + +- adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); ++ adc->dma_chan = dma_request_chan(dev, "rx"); + if (IS_ERR(adc->dma_chan)) { + int ret = PTR_ERR(adc->dma_chan); + +@@ -997,7 +998,7 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev, + &adc->dfsdm->ch_list[ch->channel]); + } + +-static int stm32_dfsdm_audio_init(struct iio_dev *indio_dev) ++static int stm32_dfsdm_audio_init(struct device *dev, struct iio_dev *indio_dev) + { + struct iio_chan_spec *ch; + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); +@@ -1027,10 +1028,10 @@ static int stm32_dfsdm_audio_init(struct iio_dev *indio_dev) + indio_dev->num_channels = 1; + indio_dev->channels = ch; + +- return stm32_dfsdm_dma_request(indio_dev); ++ return stm32_dfsdm_dma_request(dev, indio_dev); + } + +-static int stm32_dfsdm_adc_init(struct iio_dev *indio_dev) ++static int stm32_dfsdm_adc_init(struct device *dev, struct iio_dev *indio_dev) + { + struct iio_chan_spec *ch; + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); +@@ -1174,7 +1175,7 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev) + adc->dfsdm->fl_list[adc->fl_id].sync_mode = val; + + adc->dev_data = dev_data; +- ret = dev_data->init(iio); ++ ret = dev_data->init(dev, iio); + if (ret < 0) + return ret; + +-- +2.25.1 + diff --git a/queue-4.19/iio-adc-stm32-dfsdm-use-dma_request_chan-instead-dma.patch b/queue-4.19/iio-adc-stm32-dfsdm-use-dma_request_chan-instead-dma.patch new file mode 100644 index 00000000000..387d1d2d0ab --- /dev/null +++ b/queue-4.19/iio-adc-stm32-dfsdm-use-dma_request_chan-instead-dma.patch @@ -0,0 +1,49 @@ +From fcbc9567380e29325a0ba565134a134e3364b859 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Jan 2020 13:45:32 +0200 +Subject: iio: adc: stm32-dfsdm: Use dma_request_chan() instead + dma_request_slave_channel() + +From: Peter Ujfalusi + +[ Upstream commit a9ab624edd9186fbad734cfe5d606a6da3ca34db ] + +dma_request_slave_channel() is a wrapper on top of dma_request_chan() +eating up the error code. + +By using dma_request_chan() directly the driver can support deferred +probing against DMA. + +Signed-off-by: Peter Ujfalusi +Acked-by: Olivier Moysan +Acked-by: Fabrice Gasnier +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/adc/stm32-dfsdm-adc.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c +index f5586dd6414d..516d7d22d9f4 100644 +--- a/drivers/iio/adc/stm32-dfsdm-adc.c ++++ b/drivers/iio/adc/stm32-dfsdm-adc.c +@@ -933,9 +933,13 @@ static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev) + }; + int ret; + +- adc->dma_chan = dma_request_slave_channel(&indio_dev->dev, "rx"); +- if (!adc->dma_chan) +- return -EINVAL; ++ adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); ++ if (IS_ERR(adc->dma_chan)) { ++ int ret = PTR_ERR(adc->dma_chan); ++ ++ adc->dma_chan = NULL; ++ return ret; ++ } + + adc->rx_buf = dma_alloc_coherent(adc->dma_chan->device->dev, + DFSDM_DMA_BUFFER_SIZE, +-- +2.25.1 + diff --git a/queue-4.19/rxrpc-fix-ack-discard.patch b/queue-4.19/rxrpc-fix-ack-discard.patch new file mode 100644 index 00000000000..ad171998fb4 --- /dev/null +++ b/queue-4.19/rxrpc-fix-ack-discard.patch @@ -0,0 +1,157 @@ +From dd7dca945b9e704ad85bb581629a919bd6a65724 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Apr 2020 23:48:43 +0100 +Subject: rxrpc: Fix ack discard + +From: David Howells + +[ Upstream commit 441fdee1eaf050ef0040bde0d7af075c1c6a6d8b ] + +The Rx protocol has a "previousPacket" field in it that is not handled in +the same way by all protocol implementations. Sometimes it contains the +serial number of the last DATA packet received, sometimes the sequence +number of the last DATA packet received and sometimes the highest sequence +number so far received. + +AF_RXRPC is using this to weed out ACKs that are out of date (it's possible +for ACK packets to get reordered on the wire), but this does not work with +OpenAFS which will just stick the sequence number of the last packet seen +into previousPacket. + +The issue being seen is that big AFS FS.StoreData RPC (eg. of ~256MiB) are +timing out when partly sent. A trace was captured, with an additional +tracepoint to show ACKs being discarded in rxrpc_input_ack(). Here's an +excerpt showing the problem. + + 52873.203230: rxrpc_tx_data: c=000004ae DATA ed1a3584:00000002 0002449c q=00024499 fl=09 + +A DATA packet with sequence number 00024499 has been transmitted (the "q=" +field). + + ... + 52873.243296: rxrpc_rx_ack: c=000004ae 00012a2b DLY r=00024499 f=00024497 p=00024496 n=0 + 52873.243376: rxrpc_rx_ack: c=000004ae 00012a2c IDL r=0002449b f=00024499 p=00024498 n=0 + 52873.243383: rxrpc_rx_ack: c=000004ae 00012a2d OOS r=0002449d f=00024499 p=0002449a n=2 + +The Out-Of-Sequence ACK indicates that the server didn't see DATA sequence +number 00024499, but did see seq 0002449a (previousPacket, shown as "p=", +skipped the number, but firstPacket, "f=", which shows the bottom of the +window is set at that point). + + 52873.252663: rxrpc_retransmit: c=000004ae q=24499 a=02 xp=14581537 + 52873.252664: rxrpc_tx_data: c=000004ae DATA ed1a3584:00000002 000244bc q=00024499 fl=0b *RETRANS* + +The packet has been retransmitted. Retransmission recurs until the peer +says it got the packet. + + 52873.271013: rxrpc_rx_ack: c=000004ae 00012a31 OOS r=000244a1 f=00024499 p=0002449e n=6 + +More OOS ACKs indicate that the other packets that are already in the +transmission pipeline are being received. The specific-ACK list is up to 6 +ACKs and NAKs. + + ... + 52873.284792: rxrpc_rx_ack: c=000004ae 00012a49 OOS r=000244b9 f=00024499 p=000244b6 n=30 + 52873.284802: rxrpc_retransmit: c=000004ae q=24499 a=0a xp=63505500 + 52873.284804: rxrpc_tx_data: c=000004ae DATA ed1a3584:00000002 000244c2 q=00024499 fl=0b *RETRANS* + 52873.287468: rxrpc_rx_ack: c=000004ae 00012a4a OOS r=000244ba f=00024499 p=000244b7 n=31 + 52873.287478: rxrpc_rx_ack: c=000004ae 00012a4b OOS r=000244bb f=00024499 p=000244b8 n=32 + +At this point, the server's receive window is full (n=32) with presumably 1 +NAK'd packet and 31 ACK'd packets. We can't transmit any more packets. + + 52873.287488: rxrpc_retransmit: c=000004ae q=24499 a=0a xp=61327980 + 52873.287489: rxrpc_tx_data: c=000004ae DATA ed1a3584:00000002 000244c3 q=00024499 fl=0b *RETRANS* + 52873.293850: rxrpc_rx_ack: c=000004ae 00012a4c DLY r=000244bc f=000244a0 p=00024499 n=25 + +And now we've received an ACK indicating that a DATA retransmission was +received. 7 packets have been processed (the occupied part of the window +moved, as indicated by f= and n=). + + 52873.293853: rxrpc_rx_discard_ack: c=000004ae r=00012a4c 000244a0<00024499 00024499<000244b8 + +However, the DLY ACK gets discarded because its previousPacket has gone +backwards (from p=000244b8, in the ACK at 52873.287478 to p=00024499 in the +ACK at 52873.293850). + +We then end up in a continuous cycle of retransmit/discard. kafs fails to +update its window because it's discarding the ACKs and can't transmit an +extra packet that would clear the issue because the window is full. +OpenAFS doesn't change the previousPacket value in the ACKs because no new +DATA packets are received with a different previousPacket number. + +Fix this by altering the discard check to only discard an ACK based on +previousPacket if there was no advance in the firstPacket. This allows us +to transmit a new packet which will cause previousPacket to advance in the +next ACK. + +The check, however, needs to allow for the possibility that previousPacket +may actually have had the serial number placed in it instead - in which +case it will go outside the window and we should ignore it. + +Fixes: 1a2391c30c0b ("rxrpc: Fix detection of out of order acks") +Reported-by: Dave Botsch +Signed-off-by: David Howells +Signed-off-by: Sasha Levin +--- + net/rxrpc/input.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c +index 4cc3b54ebc49..e65b230fce4c 100644 +--- a/net/rxrpc/input.c ++++ b/net/rxrpc/input.c +@@ -814,6 +814,30 @@ static void rxrpc_input_soft_acks(struct rxrpc_call *call, u8 *acks, + } + } + ++/* ++ * Return true if the ACK is valid - ie. it doesn't appear to have regressed ++ * with respect to the ack state conveyed by preceding ACKs. ++ */ ++static bool rxrpc_is_ack_valid(struct rxrpc_call *call, ++ rxrpc_seq_t first_pkt, rxrpc_seq_t prev_pkt) ++{ ++ rxrpc_seq_t base = READ_ONCE(call->ackr_first_seq); ++ ++ if (after(first_pkt, base)) ++ return true; /* The window advanced */ ++ ++ if (before(first_pkt, base)) ++ return false; /* firstPacket regressed */ ++ ++ if (after_eq(prev_pkt, call->ackr_prev_seq)) ++ return true; /* previousPacket hasn't regressed. */ ++ ++ /* Some rx implementations put a serial number in previousPacket. */ ++ if (after_eq(prev_pkt, base + call->tx_winsize)) ++ return false; ++ return true; ++} ++ + /* + * Process an ACK packet. + * +@@ -878,8 +902,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, + } + + /* Discard any out-of-order or duplicate ACKs (outside lock). */ +- if (before(first_soft_ack, call->ackr_first_seq) || +- before(prev_pkt, call->ackr_prev_seq)) { ++ if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) { + trace_rxrpc_rx_discard_ack(call->debug_id, sp->hdr.serial, + first_soft_ack, call->ackr_first_seq, + prev_pkt, call->ackr_prev_seq); +@@ -895,8 +918,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, + spin_lock(&call->input_lock); + + /* Discard any out-of-order or duplicate ACKs (inside lock). */ +- if (before(first_soft_ack, call->ackr_first_seq) || +- before(prev_pkt, call->ackr_prev_seq)) { ++ if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) { + trace_rxrpc_rx_discard_ack(call->debug_id, sp->hdr.serial, + first_soft_ack, call->ackr_first_seq, + prev_pkt, call->ackr_prev_seq); +-- +2.25.1 + diff --git a/queue-4.19/rxrpc-trace-discarded-acks.patch b/queue-4.19/rxrpc-trace-discarded-acks.patch new file mode 100644 index 00000000000..51df4a4d3db --- /dev/null +++ b/queue-4.19/rxrpc-trace-discarded-acks.patch @@ -0,0 +1,100 @@ +From 11644d8cb258eade75a18ae7cf544c7c396b3d17 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 28 Apr 2020 22:06:54 +0100 +Subject: rxrpc: Trace discarded ACKs + +From: David Howells + +[ Upstream commit d1f129470e6cb79b8b97fecd12689f6eb49e27fe ] + +Add a tracepoint to track received ACKs that are discarded due to being +outside of the Tx window. + +Signed-off-by: David Howells +Signed-off-by: Sasha Levin +--- + include/trace/events/rxrpc.h | 35 +++++++++++++++++++++++++++++++++++ + net/rxrpc/input.c | 12 ++++++++++-- + 2 files changed, 45 insertions(+), 2 deletions(-) + +diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h +index 0924119bcfa4..bc5b232440b6 100644 +--- a/include/trace/events/rxrpc.h ++++ b/include/trace/events/rxrpc.h +@@ -1549,6 +1549,41 @@ TRACE_EVENT(rxrpc_notify_socket, + __entry->serial) + ); + ++TRACE_EVENT(rxrpc_rx_discard_ack, ++ TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, ++ rxrpc_seq_t first_soft_ack, rxrpc_seq_t call_ackr_first, ++ rxrpc_seq_t prev_pkt, rxrpc_seq_t call_ackr_prev), ++ ++ TP_ARGS(debug_id, serial, first_soft_ack, call_ackr_first, ++ prev_pkt, call_ackr_prev), ++ ++ TP_STRUCT__entry( ++ __field(unsigned int, debug_id ) ++ __field(rxrpc_serial_t, serial ) ++ __field(rxrpc_seq_t, first_soft_ack) ++ __field(rxrpc_seq_t, call_ackr_first) ++ __field(rxrpc_seq_t, prev_pkt) ++ __field(rxrpc_seq_t, call_ackr_prev) ++ ), ++ ++ TP_fast_assign( ++ __entry->debug_id = debug_id; ++ __entry->serial = serial; ++ __entry->first_soft_ack = first_soft_ack; ++ __entry->call_ackr_first = call_ackr_first; ++ __entry->prev_pkt = prev_pkt; ++ __entry->call_ackr_prev = call_ackr_prev; ++ ), ++ ++ TP_printk("c=%08x r=%08x %08x<%08x %08x<%08x", ++ __entry->debug_id, ++ __entry->serial, ++ __entry->first_soft_ack, ++ __entry->call_ackr_first, ++ __entry->prev_pkt, ++ __entry->call_ackr_prev) ++ ); ++ + #endif /* _TRACE_RXRPC_H */ + + /* This part must be outside protection */ +diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c +index d9beb28fc32f..4cc3b54ebc49 100644 +--- a/net/rxrpc/input.c ++++ b/net/rxrpc/input.c +@@ -879,8 +879,12 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, + + /* Discard any out-of-order or duplicate ACKs (outside lock). */ + if (before(first_soft_ack, call->ackr_first_seq) || +- before(prev_pkt, call->ackr_prev_seq)) ++ before(prev_pkt, call->ackr_prev_seq)) { ++ trace_rxrpc_rx_discard_ack(call->debug_id, sp->hdr.serial, ++ first_soft_ack, call->ackr_first_seq, ++ prev_pkt, call->ackr_prev_seq); + return; ++ } + + buf.info.rxMTU = 0; + ioffset = offset + nr_acks + 3; +@@ -892,8 +896,12 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, + + /* Discard any out-of-order or duplicate ACKs (inside lock). */ + if (before(first_soft_ack, call->ackr_first_seq) || +- before(prev_pkt, call->ackr_prev_seq)) ++ before(prev_pkt, call->ackr_prev_seq)) { ++ trace_rxrpc_rx_discard_ack(call->debug_id, sp->hdr.serial, ++ first_soft_ack, call->ackr_first_seq, ++ prev_pkt, call->ackr_prev_seq); + goto out; ++ } + call->acks_latest_ts = skb->tstamp; + call->acks_latest = sp->hdr.serial; + +-- +2.25.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 0d2d2bf0956..7d466c1ec6e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -74,3 +74,9 @@ ipack-tpci200-fix-error-return-code-in-tpci200_register.patch rapidio-fix-an-error-in-get_user_pages_fast-error-handling.patch rxrpc-fix-a-memory-leak-in-rxkad_verify_response.patch x86-unwind-orc-fix-unwind_get_return_address_ptr-for-inactive-tasks.patch +iio-adc-stm32-adc-use-dma_request_chan-instead-dma_r.patch +iio-adc-stm32-adc-fix-device-used-to-request-dma.patch +iio-adc-stm32-dfsdm-use-dma_request_chan-instead-dma.patch +iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch +rxrpc-trace-discarded-acks.patch +rxrpc-fix-ack-discard.patch