All of lore.kernel.org
 help / color / mirror / Atom feed
* [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether
@ 2018-05-24 16:05 Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 1/7] usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c Biju Das
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

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(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 1/7] usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 2/7] usb: gadget: u_ether: add a flag to avoid skb_reserve() calling Biju Das
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

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().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit 60e7396f820fa67a007f2a2eb5d97d3e77a74881)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 include/linux/usb/gadget.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 3d583a1..2ba866f 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -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
  */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 2/7] usb: gadget: u_ether: add a flag to avoid skb_reserve() calling
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 1/7] usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 3/7] usb: gadget: f_ncm: add support for no_skb_reserve Biju Das
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

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.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit 05f6b0ff68429bb7c6b84b35e71b522c3bae76ae)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/usb/gadget/function/u_ether.c | 5 ++++-
 drivers/usb/gadget/function/u_ether.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 7413f89..96ec10d 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -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;
diff --git a/drivers/usb/gadget/function/u_ether.h b/drivers/usb/gadget/function/u_ether.h
index c77145b..81d94a7 100644
--- a/drivers/usb/gadget/function/u_ether.h
+++ b/drivers/usb/gadget/function/u_ether.h
@@ -64,6 +64,7 @@ struct gether {
 	struct usb_ep			*out_ep;
 
 	bool				is_zlp_ok;
+	bool				no_skb_reserve;
 
 	u16				cdc_filter;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 3/7] usb: gadget: f_ncm: add support for no_skb_reserve
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 1/7] usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 2/7] usb: gadget: u_ether: add a flag to avoid skb_reserve() calling Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 4/7] usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used Biju Das
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

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.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit c4824f11fe07835c63209fb035f03f8f82e12827)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/usb/gadget/function/f_ncm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index 7ad798a..025047f 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 4/7] usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
                   ` (2 preceding siblings ...)
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 3/7] usb: gadget: f_ncm: add support for no_skb_reserve Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 5/7] usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether Biju Das
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

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

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit ee5acabf5805612c72084276e0c215367a042d71)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/usb/renesas_usbhs/mod_gadget.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 8647d2c..8cb3815 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 5/7] usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
                   ` (3 preceding siblings ...)
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 4/7] usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 6/7] dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all() Biju Das
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Dmitry Osipenko <digetx@gmail.com>

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.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit 0852659ef071ccd84e85e37195e7c2f3e7c64d1f)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 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(-)

diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index 025047f..7ad798a 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -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);
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 96ec10d..be41ae5 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -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;
diff --git a/drivers/usb/gadget/function/u_ether.h b/drivers/usb/gadget/function/u_ether.h
index 81d94a7..c77145b 100644
--- a/drivers/usb/gadget/function/u_ether.h
+++ b/drivers/usb/gadget/function/u_ether.h
@@ -64,7 +64,6 @@ struct gether {
 	struct usb_ep			*out_ep;
 
 	bool				is_zlp_ok;
-	bool				no_skb_reserve;
 
 	u16				cdc_filter;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 6/7] dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all()
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
                   ` (4 preceding siblings ...)
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 5/7] usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes Biju Das
  2018-05-30 17:44 ` [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Ben Hutchings
  7 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

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().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit d9f5efade2cfd729138a7cafb46d01044da40f5e)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/dma/sh/usb-dmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c
index 56410ea..6682b3e 100644
--- a/drivers/dma/sh/usb-dmac.c
+++ b/drivers/dma/sh/usb-dmac.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
                   ` (5 preceding siblings ...)
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 6/7] dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all() Biju Das
@ 2018-05-24 16:05 ` Biju Das
  2018-05-30 18:04   ` Ben Hutchings
  2018-05-30 17:44 ` [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Ben Hutchings
  7 siblings, 1 reply; 15+ messages in thread
From: Biju Das @ 2018-05-24 16:05 UTC (permalink / raw)
  To: cip-dev

From: Geert Uytterhoeven <geert+renesas@glider.be>

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

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6161cc147277e7537d73a45d732a7112997c20f6)
(enabled only USB-DMAC apart from previously enabled CAN and
 CAN_RCAR)
Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 arch/arm/configs/shmobile_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index 31d7ccc..69b95f5 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether
  2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
                   ` (6 preceding siblings ...)
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes Biju Das
@ 2018-05-30 17:44 ` Ben Hutchings
  2018-06-26  9:13   ` Biju Das
  7 siblings, 1 reply; 15+ messages in thread
From: Ben Hutchings @ 2018-05-30 17:44 UTC (permalink / raw)
  To: cip-dev

On Thu, 2018-05-24 at 17:05 +0100, Biju Das wrote:
> 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.

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.

> 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(-)
> 
-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes
  2018-05-24 16:05 ` [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes Biju Das
@ 2018-05-30 18:04   ` Ben Hutchings
  2018-05-30 18:16     ` Biju Das
  0 siblings, 1 reply; 15+ messages in thread
From: Ben Hutchings @ 2018-05-30 18:04 UTC (permalink / raw)
  To: cip-dev

On Thu, 2018-05-24 at 17:05 +0100, Biju Das wrote:
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Enable all missing support, extracted from the various Renesas ARM DTSes
> using linux-config-from-dt.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> (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.

> Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> ---
> ?arch/arm/configs/shmobile_defconfig | 1 +
> ?1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> index 31d7ccc..69b95f5 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -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
-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes
  2018-05-30 18:04   ` Ben Hutchings
@ 2018-05-30 18:16     ` Biju Das
  2018-05-30 18:22       ` Ben Hutchings
  0 siblings, 1 reply; 15+ messages in thread
From: Biju Das @ 2018-05-30 18:16 UTC (permalink / raw)
  To: cip-dev

Hi Ben,

Thanks for the feedback.

> -----Original Message-----
> From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
> Sent: 30 May 2018 19:05
> To: Biju Das <biju.das@bp.renesas.com>
> Cc: Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro
> <fabrizio.castro@bp.renesas.com>; cip-dev at lists.cip-project.org
> Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing
> support based on DTSes
>
> On Thu, 2018-05-24 at 17:05 +0100, Biju Das wrote:
> > From: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > Enable all missing support, extracted from the various Renesas ARM
> > DTSes using linux-config-from-dt.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au> (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.

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

> (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.)
>
> > Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> > ---
> >  arch/arm/configs/shmobile_defconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/arm/configs/shmobile_defconfig
> > b/arch/arm/configs/shmobile_defconfig
> > index 31d7ccc..69b95f5 100644
> > --- a/arch/arm/configs/shmobile_defconfig
> > +++ b/arch/arm/configs/shmobile_defconfig
> > @@ -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
> --
> 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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes
  2018-05-30 18:16     ` Biju Das
@ 2018-05-30 18:22       ` Ben Hutchings
  2018-05-30 18:26         ` Biju Das
  0 siblings, 1 reply; 15+ messages in thread
From: Ben Hutchings @ 2018-05-30 18:22 UTC (permalink / raw)
  To: cip-dev

On Wed, 2018-05-30 at 18:16 +0000, Biju Das wrote:
> Hi Ben,
> 
> Thanks for the feedback.
> 
> > -----Original Message-----
> > From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
> > Sent: 30 May 2018 19:05
> > To: Biju Das <biju.das@bp.renesas.com>
> > Cc: Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro
> > <fabrizio.castro@bp.renesas.com>; cip-dev at lists.cip-project.org
> > Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing
> > support based on DTSes
> > 
> > On Thu, 2018-05-24 at 17:05 +0100, Biju Das wrote:
> > > From: Geert Uytterhoeven <geert+renesas@glider.be>
> > > 
> > > Enable all missing support, extracted from the various Renesas ARM
> > > DTSes using linux-config-from-dt.
> > > 
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > Signed-off-by: Simon Horman <horms+renesas@verge.net.au> (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.
> 
> 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.

> 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.

-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes
  2018-05-30 18:22       ` Ben Hutchings
@ 2018-05-30 18:26         ` Biju Das
  0 siblings, 0 replies; 15+ messages in thread
From: Biju Das @ 2018-05-30 18:26 UTC (permalink / raw)
  To: cip-dev

Hi Ben,

Thanks for the feedback.

> -----Original Message-----
> From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
> Sent: 30 May 2018 19:23
> To: Biju Das <biju.das@bp.renesas.com>
> Cc: Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro
> <fabrizio.castro@bp.renesas.com>; cip-dev at lists.cip-project.org
> Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing
> support based on DTSes
>
> On Wed, 2018-05-30 at 18:16 +0000, Biju Das wrote:
> > Hi Ben,
> >
> > Thanks for the feedback.
> >
> > > -----Original Message-----
> > > From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
> > > Sent: 30 May 2018 19:05
> > > To: Biju Das <biju.das@bp.renesas.com>
> > > Cc: Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro
> > > <fabrizio.castro@bp.renesas.com>; cip-dev at lists.cip-project.org
> > > Subject: Re: [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable
> > > missing support based on DTSes
> > >
> > > On Thu, 2018-05-24 at 17:05 +0100, Biju Das wrote:
> > > > From: Geert Uytterhoeven <geert+renesas@glider.be>
> > > >
> > > > Enable all missing support, extracted from the various Renesas ARM
> > > > DTSes using linux-config-from-dt.
> > > >
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > > Signed-off-by: Simon Horman <horms+renesas@verge.net.au> (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.
> >
> > 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.
>
> > 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.

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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether
  2018-05-30 17:44 ` [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Ben Hutchings
@ 2018-06-26  9:13   ` Biju Das
  2018-07-08 20:02     ` Ben Hutchings
  0 siblings, 1 reply; 15+ messages in thread
From: Biju Das @ 2018-06-26  9:13 UTC (permalink / raw)
  To: cip-dev

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

> -----Original Message-----
> From: Ben Hutchings [mailto:ben.hutchings at codethink.co.uk]
> Sent: 30 May 2018 18:44
> To: Biju Das <biju.das@bp.renesas.com>
> Cc: Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro
> <fabrizio.castro@bp.renesas.com>; cip-dev at lists.cip-project.org
> Subject: Re: [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether
>
> On Thu, 2018-05-24 at 17:05 +0100, Biju Das wrote:
> > 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.
>
> 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.
>
> > 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(-)
> >
> --
> 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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether
  2018-06-26  9:13   ` Biju Das
@ 2018-07-08 20:02     ` Ben Hutchings
  0 siblings, 0 replies; 15+ messages in thread
From: Ben Hutchings @ 2018-07-08 20:02 UTC (permalink / raw)
  To: cip-dev

On Tue, 2018-06-26 at 09:13 +0000, Biju Das wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-07-08 20:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24 16:05 [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 1/7] usb: gadget: add a new quirk to avoid skb_reserve in u_ether.c Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 2/7] usb: gadget: u_ether: add a flag to avoid skb_reserve() calling Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 3/7] usb: gadget: f_ncm: add support for no_skb_reserve Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 4/7] usb: renesas_usbhs: set quirk_avoids_skb_reserve if USB-DMAC is used Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 5/7] usb: gadget: f_ncm/u_ether: Move 'SKB reserve' quirk setup to u_ether Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 6/7] dmaengine: usb-dmac: fix endless loop in usb_dmac_chan_terminate_all() Biju Das
2018-05-24 16:05 ` [cip-dev] [RFC PATCH 7/7] ARM: shmobile: defconfig: Enable missing support based on DTSes Biju Das
2018-05-30 18:04   ` Ben Hutchings
2018-05-30 18:16     ` Biju Das
2018-05-30 18:22       ` Ben Hutchings
2018-05-30 18:26         ` Biju Das
2018-05-30 17:44 ` [cip-dev] [RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether Ben Hutchings
2018-06-26  9:13   ` Biju Das
2018-07-08 20:02     ` Ben Hutchings

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.