Skip to contentSkip to conversation

'SKB reserve' quirk setup to u_ether

RFC PATCH New Biju Das 2 participants 15 messages May 24, 2018 – Jul 8, 2018

Subsystems (4)
lore
Share & tools
lore

Biju Das

author
#0 lore raw

cover 'SKB reserve' quirk setup to u_ether

Hi All,

Some platforms (e.g. USB-DMAC on R-Car and RZ/G1 SoCs) has memory alignment restriction. If memory alignment is not match, the usb peripheral driver decides not to use the DMA controller. Then, the performance is not good.

Patch 1-4 --> basically add support only for NCM network model.

Patch 5--> supports for all network models.

Patch 6-->fixes cpulock up condition on the USB DMAC driver

Patch 7--> enables USB DMAC

Renesas USB DMAC driver is not enabled in 4.4 stable kernel. So not planning to send the patch set to stable kernel.

Cheers,
Biju

Dmitry Osipenko (1):
usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether

Geert Uytterhoeven (1):
ARM: shmobile: defconfig: Enable missing support based on DTSes

Yoshihiro Shimoda (5):
usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c
usb: gadget: u_ether: add a flag to avoid skb_reserve() calling
usb: gadget: f_ncm: add support for no_skb_reserve
usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used
dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all()

 arch/arm/configs/shmobile_defconfig    |  1 +
 drivers/dma/sh/usb-dmac.c              |  4 ++--
 drivers/usb/gadget/function/u_ether.c  |  5 ++++-
 drivers/usb/renesas_usbhs/mod_gadget.c |  2 ++
 include/linux/usb/gadget.h             | 13 +++++++++++++
 5 files changed, 22 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

RFC PATCH 1/7 usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c

From: Yoshihiro Shimoda <[email protected]>

Some platforms (e.g. USB-DMAC on R-Car SoCs) has memory alignment restriction. If memory alignment is not match, the usb peripheral driver decides not to use the DMA controller. Then, the performance is not good.

In the case of u_ether.c, since it calls skb_reserve() in rx_submit(), it is possible to cause memory alignment mismatch.

So, this patch adds a new quirk "quirk_avoids_skb_reserve" to avoid skb_reserve() calling in u_ether.c to improve performance.

A peripheral driver will set this flag and network gadget drivers (e.g. f_ncm.c) will reference the flag via gadget_avoids_skb_reserve().

(cherry picked from commit 60e7396f820fa67a007f2a2eb5d97d3e77a74881)
---
 include/linux/usb/gadget.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
include/linux/usb/gadget.h +13 -0
index 3d583a1..2ba866f 100644
@@ -594,6 +594,8 @@ struct usb_gadget_ops {
  *	enabled HNP support.
  * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to
  *	MaxPacketSize.
+ * @quirk_avoids_skb_reserve: udc/platform wants to avoid skb_reserve() in
+ *	u_ether.c to improve performance.
  * @is_selfpowered: if the gadget is self-powered.
  * @deactivated: True if gadget is deactivated - in deactivated state it cannot
  *	be connected.
@@ -643,6 +645,7 @@ struct usb_gadget {
 	unsigned			quirk_altset_not_supp:1;
 	unsigned			quirk_stall_not_supp:1;
 	unsigned			quirk_zlp_not_supp:1;
+	unsigned			quirk_avoids_skb_reserve:1;
 	unsigned			is_selfpowered:1;
 	unsigned			deactivated:1;
 	unsigned			connected:1;
@@ -708,6 +711,16 @@ static inline int gadget_is_zlp_supported(struct usb_gadget *g)
 }
 
 /**
+ * gadget_avoids_skb_reserve - return true iff the hardware would like to avoid
+ *	skb_reserve to improve performance.
+ * @g: controller to check for quirk
+ */
+static inline int gadget_avoids_skb_reserve(struct usb_gadget *g)
+{
+	return g->quirk_avoids_skb_reserve;
+}
+
+/**
  * gadget_is_dualspeed - return true iff the hardware handles high speed
  * @g: controller that might support both high and full speeds
  */
Signature · 1 line
2.7.4
author
#2 lore raw

RFC PATCH 2/7 usb: gadget: u_ether: add a flag to avoid skb_reserve() calling

In reply to Biju Das

From: Yoshihiro Shimoda <[email protected]>

This patch adds a flag "no_skb_reserve" in struct eth_dev. So, if a peripheral driver sets the quirk_avoids_skb_reserve flag, upper network gadget drivers (e.g. f_ncm.c) can avoid skb_reserve() calling using the flag as well.

(cherry picked from commit 05f6b0ff68429bb7c6b84b35e71b522c3bae76ae)
---
 drivers/usb/gadget/function/u_ether.c | 5 ++++-
 drivers/usb/gadget/function/u_ether.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/u_ether.c +4 -1
index 7413f89..96ec10d 100644
@@ -82,6 +82,7 @@ struct eth_dev {
 #define	WORK_RX_MEMORY		0
 
 	bool			zlp;
+	bool			no_skb_reserve;
 	u8			host_mac[ETH_ALEN];
 	u8			dev_mac[ETH_ALEN];
 };
@@ -243,7 +244,8 @@ rx_submit(struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
 	 * but on at least one, checksumming fails otherwise.  Note:
 	 * RNDIS headers involve variable numbers of LE32 values.
 	 */
-	skb_reserve(skb, NET_IP_ALIGN);
+	if (likely(!dev->no_skb_reserve))
+		skb_reserve(skb, NET_IP_ALIGN);
 
 	req->buf = skb->data;
 	req->length = size;
@@ -1065,6 +1067,7 @@ struct net_device *gether_connect(struct gether *link)
 
 	if (result == 0) {
 		dev->zlp = link->is_zlp_ok;
+		dev->no_skb_reserve = link->no_skb_reserve;
 		DBG(dev, "qlen %d\n", qlen(dev->gadget, dev->qmult));
 
 		dev->header_len = link->header_len;
drivers/usb/gadget/function/u_ether.h +1 -0
index c77145b..81d94a7 100644
@@ -64,6 +64,7 @@ struct gether {
 	struct usb_ep			*out_ep;
 
 	bool				is_zlp_ok;
+	bool				no_skb_reserve;
 
 	u16				cdc_filter;
 
Signature · 1 line
2.7.4
author
#3 lore raw

RFC PATCH 3/7 usb: gadget: f_ncm: add support for no_skb_reserve

In reply to Biju Das

From: Yoshihiro Shimoda <[email protected]>

This patch adds to support no_skb_reserve function to improve performance for some platforms. About the detail, please refer to the commit log of "quirk_avoids_skb_reserve" in include/linux/usb/gadget.h.

(cherry picked from commit c4824f11fe07835c63209fb035f03f8f82e12827)
---
 drivers/usb/gadget/function/f_ncm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/function/f_ncm.c +2 -0
index 7ad798a..025047f 100644
@@ -852,6 +852,8 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 			 */
 			ncm->port.is_zlp_ok =
 				gadget_is_zlp_supported(cdev->gadget);
+			ncm->port.no_skb_reserve =
+				gadget_avoids_skb_reserve(cdev->gadget);
 			ncm->port.cdc_filter = DEFAULT_FILTER;
 			DBG(cdev, "activate ncm\n");
 			net = gether_connect(&ncm->port);
Signature · 1 line
2.7.4
author
#4 lore raw

RFC PATCH 4/7 usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used

In reply to Biju Das

From: Yoshihiro Shimoda <[email protected]>

This patch sets the quirk_avoids_skb_reserve flag to improve performance of a network gadget driver (e.g. f_ncm.c) if USB-DMAC is used.

For example (on r8a7795 board + f_ncm.c + iperf udp mode / receiving):
- without this patch: 90.3 Mbits/sec
- with this patch: 273 Mbits/sec

(cherry picked from commit ee5acabf5805612c72084276e0c215367a042d71)
---
 drivers/usb/renesas_usbhs/mod_gadget.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/renesas_usbhs/mod_gadget.c +2 -0
index 8647d2c..8cb3815 100644
@@ -1122,6 +1122,8 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
 	gpriv->gadget.name		= "renesas_usbhs_udc";
 	gpriv->gadget.ops		= &usbhsg_gadget_ops;
 	gpriv->gadget.max_speed		= USB_SPEED_HIGH;
+	gpriv->gadget.quirk_avoids_skb_reserve = usbhs_get_dparam(priv,
+								has_usb_dmac);
 
 	INIT_LIST_HEAD(&gpriv->gadget.ep_list);
 
Signature · 1 line
2.7.4
author
#5 lore raw

RFC PATCH 5/7 usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether

In reply to Biju Das

From: Dmitry Osipenko <[email protected]>

That quirk is required to make USB Ethernet gadget working on HW that can't cope with unaligned DMA. For some reason only f_ncm sets up that quirk, let's setup it directly in u_ether so other network models would have that quirk applied as well. All network models have been tested with ChipIdea UDC driver on NVIDIA Tegra20 SoC that require DMA to be aligned.

(cherry picked from commit 0852659ef071ccd84e85e37195e7c2f3e7c64d1f)
---
 drivers/usb/gadget/function/f_ncm.c   | 2 --
 drivers/usb/gadget/function/u_ether.c | 2 +-
 drivers/usb/gadget/function/u_ether.h | 1 -
 3 files changed, 1 insertion(+), 4 deletions(-)
drivers/usb/gadget/function/f_ncm.c +0 -2
index 025047f..7ad798a 100644
@@ -852,8 +852,6 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 			 */
 			ncm->port.is_zlp_ok =
 				gadget_is_zlp_supported(cdev->gadget);
-			ncm->port.no_skb_reserve =
-				gadget_avoids_skb_reserve(cdev->gadget);
 			ncm->port.cdc_filter = DEFAULT_FILTER;
 			DBG(cdev, "activate ncm\n");
 			net = gether_connect(&ncm->port);
drivers/usb/gadget/function/u_ether.c +1 -1
index 96ec10d..be41ae5 100644
@@ -1067,7 +1067,7 @@ struct net_device *gether_connect(struct gether *link)
 
 	if (result == 0) {
 		dev->zlp = link->is_zlp_ok;
-		dev->no_skb_reserve = link->no_skb_reserve;
+		dev->no_skb_reserve = gadget_avoids_skb_reserve(dev->gadget);
 		DBG(dev, "qlen %d\n", qlen(dev->gadget, dev->qmult));
 
 		dev->header_len = link->header_len;
drivers/usb/gadget/function/u_ether.h +0 -1
index 81d94a7..c77145b 100644
@@ -64,7 +64,6 @@ struct gether {
 	struct usb_ep			*out_ep;
 
 	bool				is_zlp_ok;
-	bool				no_skb_reserve;
 
 	u16				cdc_filter;
 
Signature · 1 line
2.7.4
author
#6 lore raw

RFC PATCH 6/7 dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all()

In reply to Biju Das

From: Yoshihiro Shimoda <[email protected]>

This patch fixes an issue that list_for_each_entry() in usb_dmac_chan_terminate_all() is possible to cause endless loop because this will move own desc to the desc_freed. So, this driver should use list_for_each_entry_safe() instead of list_for_each_entry().

(cherry picked from commit d9f5efade2cfd729138a7cafb46d01044da40f5e)
---
 drivers/dma/sh/usb-dmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/sh/usb-dmac.c +2 -2
index 56410ea..6682b3e 100644
@@ -448,7 +448,7 @@ usb_dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 static int usb_dmac_chan_terminate_all(struct dma_chan *chan)
 {
 	struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan);
-	struct usb_dmac_desc *desc;
+	struct usb_dmac_desc *desc, *_desc;
 	unsigned long flags;
 	LIST_HEAD(head);
 	LIST_HEAD(list);
@@ -459,7 +459,7 @@ static int usb_dmac_chan_terminate_all(struct dma_chan *chan)
 	if (uchan->desc)
 		uchan->desc = NULL;
 	list_splice_init(&uchan->desc_got, &list);
-	list_for_each_entry(desc, &list, node)
+	list_for_each_entry_safe(desc, _desc, &list, node)
 		list_move_tail(&desc->node, &uchan->desc_freed);
 	spin_unlock_irqrestore(&uchan->vc.lock, flags);
 	vchan_dma_desc_free_list(&uchan->vc, &head);
Signature · 1 line
2.7.4
author
#7 lore raw

RFC PATCH 7/7 ARM: shmobile: defconfig: Enable missing support based on DTSes

In reply to Biju Das

From: Geert Uytterhoeven <[email protected]>

Enable all missing support, extracted from the various Renesas ARM DTSes using linux-config-from-dt.

(cherry picked from commit 6161cc147277e7537d73a45d732a7112997c20f6)

(enabled only USB-DMAC apart from previously enabled CAN and
CAN_RCAR)

---
 arch/arm/configs/shmobile_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/shmobile_defconfig +1 -0
index 31d7ccc..69b95f5 100644
@@ -189,6 +189,7 @@ CONFIG_RTC_DRV_RX8581=y
 CONFIG_DMADEVICES=y
 CONFIG_SH_DMAE=y
 CONFIG_RCAR_DMAC=y
+CONFIG_RENESAS_USB_DMAC=y
 # CONFIG_IOMMU_SUPPORT is not set
 CONFIG_IIO=y
 CONFIG_AK8975=y
Signature · 1 line
2.7.4
#8 lore raw

RFC PATCH 7/7 ARM: shmobile: defconfig: Enable missing support based on DTSes

Quoted 10 lines · Biju Das

From: Geert Uytterhoeven <[email protected]>

Enable all missing support, extracted from the various Renesas ARM DTSes using linux-config-from-dt.

(cherry picked from commit 6161cc147277e7537d73a45d732a7112997c20f6)

(enabled only USB-DMAC apart from previously enabled CAN and ?CAN_RCAR)

Why not apply the whole of the commit (that hasn't already been applied)? I understand that we don't need all these things enabled for the reference hardware, but this is meant to be a generic configuration for all SH-Mobile and R-Car systems.

(I don't particularly care whether we take the whole commit or not. It just seems like more work to edit out parts of it, and I want to understand your reasons for doing so.)

Ben.

Quoted 17 lines

---
?arch/arm/configs/shmobile_defconfig | 1 +
?1 file changed, 1 insertion(+)

arch/arm/configs/shmobile_defconfig +0 -0
index 31d7ccc..69b95f5 100644
@@ -189,6 +189,7 @@ CONFIG_RTC_DRV_RX8581=y

?CONFIG_DMADEVICES=y
?CONFIG_SH_DMAE=y
?CONFIG_RCAR_DMAC=y
+CONFIG_RENESAS_USB_DMAC=y
?# CONFIG_IOMMU_SUPPORT is not set
?CONFIG_IIO=y
?CONFIG_AK8975=y

Signature · 4 lines
Ben Hutchings, Software Developer                ?        Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom
We respect your privacy.?? See https://www.codethink.co.uk/privacy.html
author
#9 lore raw

RFC PATCH 7/7 ARM: shmobile: defconfig: Enable missing support based on DTSes

Hi Ben,

Thanks for the feedback.

Quoted 21 lines

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
Sent: 30 May 2018 19:05
To: Biju Das <[email protected]>
Cc: Chris Paterson <[email protected]>; Fabrizio Castro <[email protected]>; cip-dev at lists.cip-project.org
Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes

Quoted 10 lines · Biju Das

From: Geert Uytterhoeven <[email protected]>

Enable all missing support, extracted from the various Renesas ARM DTSes using linux-config-from-dt.

picked from commit 6161cc147277e7537d73a45d732a7112997c20f6) (enabled only USB-DMAC apart from previously enabled CAN and
CAN_RCAR)

Quoted 4 lines

Why not apply the whole of the commit (that hasn't already been applied)? I understand that we don't need all these things enabled for the reference hardware, but this is meant to be a generic configuration for all SH-Mobile and R-Car systems.

We are enabling the config options which are tested.
Initially we have tested CAN driver with this patch. At that point, we found that USB DMAC driver is broken with network gadget configuration. Now we found a patch series which fixes USB DMAC driver issue. So we can enable USB DMAC driver as well.

But the following IP's are not present in RZ/G1M and RZ/G1E platform. So currently we don't know the impact, if we enable the same.

CONFIG_I2C_EMEV2=y
CONFIG_VIDEO_RENESAS_JPU=y
CONFIG_RTC_DRV_DA9063=y

Quoted 19 lines

(I don't particularly care whether we take the whole commit or not. It just seems like more work to edit out parts of it, and I want to understand your reasons for doing so.)

Quoted 15 lines
---
 arch/arm/configs/shmobile_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/shmobile_defconfig +1 -0
index 31d7ccc..69b95f5 100644
@@ -189,6 +189,7 @@ CONFIG_RTC_DRV_RX8581=y
 CONFIG_DMADEVICES=y
 CONFIG_SH_DMAE=y
 CONFIG_RCAR_DMAC=y
+CONFIG_RENESAS_USB_DMAC=y
Quoted 8 lines

arch/arm/configs/shmobile_defconfig CONFIG_RTC_DRV_RX8581=y · line 195

Quoted 3 lines
arch/arm/configs/shmobile_defconfig +0 -0
 # CONFIG_IOMMU_SUPPORT is not set
 CONFIG_IIO=y
 CONFIG_AK8975=y

--
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom We respect your
privacy. See https://www.codethink.co.uk/privacy.html

Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

#10 lore raw

RFC PATCH 7/7 ARM: shmobile: defconfig: Enable missing support based on DTSes

Quoted 30 lines · Biju Das

Hi Ben,

Thanks for the feedback.

Quoted 21 lines

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
Sent: 30 May 2018 19:05
To: Biju Das <[email protected]>
Cc: Chris Paterson <[email protected]>; Fabrizio Castro <[email protected]>; cip-dev at lists.cip-project.org
Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes

Quoted 10 lines · Biju Das

From: Geert Uytterhoeven <[email protected]>

Enable all missing support, extracted from the various Renesas ARM DTSes using linux-config-from-dt.

picked from commit 6161cc147277e7537d73a45d732a7112997c20f6) (enabled only USB-DMAC apart from previously enabled CAN and ?CAN_RCAR)

Quoted 4 lines

Why not apply the whole of the commit (that hasn't already been applied)???I understand that we don't need all these things enabled for the reference hardware, but this is meant to be a generic configuration for all SH-Mobile and R-Car systems.

Quoted 4 lines

We are enabling the config options which are??tested.
Initially we have??tested CAN driver with this patch. At that point, we found that USB DMAC driver is broken with network gadget configuration. Now we found a patch series which fixes USB DMAC driver issue. So we can enable USB DMAC driver as well.

OK, that makes sense.

Quoted 6 lines

But the following IP's are not present in RZ/G1M and RZ/G1E platform. So currently we don't know the impact, if we enable the same.

CONFIG_I2C_EMEV2=y
CONFIG_VIDEO_RENESAS_JPU=y
CONFIG_RTC_DRV_DA9063=y

[...]

The impact should be none, for those platforms. :-)

I'm happy with this patch series. Patch 6 should go to 4.4-stable, but I can also apply it to 4.4-cip without waiting for that.

Ben.

Signature · 4 lines
Ben Hutchings, Software Developer                ?        Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom
We respect your privacy.?? See https://www.codethink.co.uk/privacy.html
author
#11 lore raw

RFC PATCH 7/7 ARM: shmobile: defconfig: Enable missing support based on DTSes

Hi Ben,

Thanks for the feedback.

Quoted 55 lines

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
Sent: 30 May 2018 19:23
To: Biju Das <[email protected]>
Cc: Chris Paterson <[email protected]>; Fabrizio Castro <[email protected]>; cip-dev at lists.cip-project.org
Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes

Quoted 25 lines · Biju Das

Hi Ben,

Thanks for the feedback.

Quoted 21 lines

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
Sent: 30 May 2018 19:05
To: Biju Das <[email protected]>
Cc: Chris Paterson <[email protected]>; Fabrizio Castro <[email protected]>; cip-dev at lists.cip-project.org
Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes

Quoted 10 lines · Biju Das

From: Geert Uytterhoeven <[email protected]>

Enable all missing support, extracted from the various Renesas ARM DTSes using linux-config-from-dt.

picked from commit 6161cc147277e7537d73a45d732a7112997c20f6) (enabled only USB-DMAC apart from previously enabled CAN and
CAN_RCAR)

Quoted 8 lines
Quoted 4 lines

Why not apply the whole of the commit (that hasn't already been applied)? I understand that we don't need all these things enabled for the reference hardware, but this is meant to be a generic configuration for all SH-Mobile and R-Car systems.

We are enabling the config options which are tested. Initially we have tested CAN driver with this patch. At that point, we found that USB DMAC driver is broken with network gadget

configuration. Now we found a patch series which fixes USB DMAC driver issue.

Quoted 1 line

So we can enable USB DMAC driver as well.

OK, that makes sense.

Quoted 6 lines

But the following IP's are not present in RZ/G1M and RZ/G1E platform. So currently we don't know the impact, if we enable the same.

CONFIG_I2C_EMEV2=y
CONFIG_VIDEO_RENESAS_JPU=y
CONFIG_RTC_DRV_DA9063=y

Quoted 6 lines

[...]

The impact should be none, for those platforms. :-)

I'm happy with this patch series. Patch 6 should go to 4.4-stable, but I can also apply it to 4.4-cip without waiting for that.

OK.I will send patch6 to 4.4-stable after testing this on Koelsch platform(R-Car M2-W).

Regards,
Biju

Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

#12 lore raw

cover 'SKB reserve' quirk setup to u_ether

In reply to Biju Das
Quoted 9 lines · Biju Das

Hi All,

Some platforms (e.g. USB-DMAC on R-Car and RZ/G1 SoCs) has memory alignment restriction. If memory alignment is not match, the usb peripheral driver decides not to use the DMA controller. Then, the performance is not good.

Patch 1-4 --> basically add support only for NCM network model.

Quoted 8 lines

Patch 5--> supports for all network models.

Patch 6-->fixes cpulock up condition on the USB DMAC driver

Patch 7--> enables USB DMAC

Renesas USB DMAC driver is not enabled in 4.4 stable kernel. So not planning to send the patch set to stable kernel.

The USB DMAC driver is present, so I think patch 6 should go to 4.4- stable. For the rest, I agree they can be added to 4.4-cip only.

Ben.

Quoted 23 lines

Cheers,
Biju

Dmitry Osipenko (1):
? usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether

Geert Uytterhoeven (1):
? ARM: shmobile: defconfig: Enable missing support based on DTSes

Yoshihiro Shimoda (5):
? usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c ? usb: gadget: u_ether: add a flag to avoid skb_reserve() calling ? usb: gadget: f_ncm: add support for no_skb_reserve
? usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used ? dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all()

?arch/arm/configs/shmobile_defconfig????|??1 +
?drivers/dma/sh/usb-dmac.c??????????????|??4 ++--
?drivers/usb/gadget/function/u_ether.c??|??5 ++++-
?drivers/usb/renesas_usbhs/mod_gadget.c |??2 ++
?include/linux/usb/gadget.h?????????????| 13 +++++++++++++

?5 files changed, 22 insertions(+), 3 deletions(-)

Signature · 4 lines
Ben Hutchings, Software Developer                ?        Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom
We respect your privacy.?? See https://www.codethink.co.uk/privacy.html
author
#13 lore raw

cover 'SKB reserve' quirk setup to u_ether

Hi Ben,

Is it the right time to apply this patch series?
Patch1-4,5 and 7.

Patch 6 is present in latest cip kernel.

Regards,
Biju

Quoted 57 lines

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
Sent: 30 May 2018 18:44
To: Biju Das <[email protected]>
Cc: Chris Paterson <[email protected]>; Fabrizio Castro <[email protected]>; cip-dev at lists.cip-project.org
Subject: Re: [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether

Quoted 9 lines · Biju Das

Hi All,

Some platforms (e.g. USB-DMAC on R-Car and RZ/G1 SoCs) has memory alignment restriction. If memory alignment is not match, the usb peripheral driver decides not to use the DMA controller. Then, the performance is not good.

Patch 1-4 --> basically add support only for NCM network model.

Quoted 8 lines

Patch 5--> supports for all network models.

Patch 6-->fixes cpulock up condition on the USB DMAC driver

Patch 7--> enables USB DMAC

Renesas USB DMAC driver is not enabled in 4.4 stable kernel. So not planning to send the patch set to stable kernel.

The USB DMAC driver is present, so I think patch 6 should go to 4.4- stable. For the rest, I agree they can be added to 4.4-cip only.

Ben.

Quoted 18 lines

Cheers,
Biju

Dmitry Osipenko (1):
usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to
u_ether

Geert Uytterhoeven (1):
ARM: shmobile: defconfig: Enable missing support based on DTSes

Yoshihiro Shimoda (5):
usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c
usb: gadget: u_ether: add a flag to avoid skb_reserve() calling
usb: gadget: f_ncm: add support for no_skb_reserve
usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used
dmaengine: usb-dmac: fix endless loop in
usb_dmac_chan_terminate_all()

Quoted 7 lines
 arch/arm/configs/shmobile_defconfig    |  1 +
 drivers/dma/sh/usb-dmac.c              |  4 ++--
 drivers/usb/gadget/function/u_ether.c  |  5 ++++-
 drivers/usb/renesas_usbhs/mod_gadget.c |  2 ++
 include/linux/usb/gadget.h             | 13 +++++++++++++
 5 files changed, 22 insertions(+), 3 deletions(-)
Quoted 5 lines

--
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom We respect your
privacy. See https://www.codethink.co.uk/privacy.html

Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

#14 lore raw

cover 'SKB reserve' quirk setup to u_ether

Quoted 6 lines · Biju Das

Hi Ben,

Is it the right time to apply this patch series?
Patch1-4,5 and 7.

Patch 6 is present in latest cip kernel.

[...]

Thanks for the reminder. I've now applied this patch series.

Ben.

Signature · 3 lines
Ben Hutchings, Software Developer                ?        Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom