Date   

Re: [PATCH] ARM: dts: r8a7743: Add VSP support

Ben Hutchings <ben.hutchings@...>
 

On Tue, 2018-05-29 at 11:08 +0100, Fabrizio Castro wrote:
From: Biju Das <biju.das@...>

Add VSP support to SoC DT.

Signed-off-by: Biju Das <biju.das@...>
(cherry picked from commit ff9b22610e8c08946f9787d9e0d1a87489624417)
This is wrong; the upstream commit is
0565605aa9887a3d6423fb08c0cbb0de3a22f838.

(dropped resets property. changed clocks and power-domains properties.
added vsp device configuration)
Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
---
Hello Ben,

this patch applies on top of v4.4.130-cip23.
[...]

I applied this and fixed the upstream commit reference. Thanks.

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


Re: [PATCH 0/7] Add HDMI support to iwg20d

Ben Hutchings <ben.hutchings@...>
 

On Tue, 2018-05-15 at 12:19 +0100, Fabrizio Castro wrote:
Dear Ben,

this series adds HDMI video output to iWave's iwg20d board.

I had to take out interrupt (hotplug) support from the hdmi DT node as
it looks like commit 9183e45db7774716d056319c237a4185baba19c7 introduced
"connector" data field with struct adv7511, but drm_connector_init was
left behind, and as such connector.dev is NULL, and that causes issues
to function adv7511_hpd_work, preventing HDMI hotplug from working
properly.

While investigating HDMI hotplugging, I have found out that when using
a GPIO purely as an interrupt source the corresponding GPIO module
clock is not enabled, therefore this series backports the fix for this.
I yet have to check if this fix is any good to 4.4 LTS, I'll send it to
stable@... in case it works for 4.4 LTS too.

This series applies on top of tag v4.4.126-cip22.
[...]

I've applied patches 1-5 only, as you requested. Thanks.

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


Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone on DT

Ben Hutchings <ben.hutchings@...>
 

On Wed, 2018-05-30 at 16:34 +0000, Biju Das wrote:
[...]
 Are you ok for backporting the above patch? If yes, then it make sense to
backport the commits 5e325868aa59 and d4b23c5c434a.
Yes, I think this is OK.  Commit e498b4984 doesn't change any existing
functions so it should be safe to add.
Shall I send only thermal related patches  or do you want me to send V2 with 65 patches?
Please let me know.
I saved that patch series, so please just let me know what needs to be
added or replaced.

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


Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone on DT

Biju Das <biju.das@...>
 

Hi Ben,

Thanks for the feedback.

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings@...]
Sent: 30 May 2018 16:29
To: Biju Das <biju.das@...>
Cc: Chris Paterson <Chris.Paterson2@...>; Fabrizio Castro
<fabrizio.castro@...>; cip-dev@...
Subject: Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone on DT

On Mon, 2018-05-21 at 13:46 +0000, Biju Das wrote:
Hi Ben,

Thanks for the feedback.

Subject: Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone
on DT

On Thu, 2018-05-10 at 16:08 +0100, Biju Das wrote:
From: Kuninori Morimoto <kuninori.morimoto.gx@...>

This patch enables to use thermal-zone on DT if it was calles as
"renesas,rcar-thermal-gen2".
Previous style (= non thermal-zone) is still supported by
"renesas,rcar-thermal" to keep compatibility for "git bisect".

Signed-off-by: Kuninori Morimoto
<kuninori.morimoto.gx@...>
Signed-off-by: Eduardo Valentin <edubezval@...> (cherry
picked from commit 8b477ea56383dc8b838f1f8b506e4571c14ceb30)
Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Fabrizio Castro <fabrizio.castro@...>
[...]
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
[...]
@@ -463,7 +492,13 @@ static int rcar_thermal_probe(struct
platform_device *pdev)
if (ret < 0)
goto error_unregister;

-priv->zone = thermal_zone_device_register("rcar_thermal",
+if (of_data == USE_OF_THERMAL)
+priv->zone = thermal_zone_of_sensor_register(
+dev, i, priv,
+
&rcar_thermal_zone_of_ops);

Doesn't this require a corresponding change to use
thermal_zone_of_sensor_unregister()?
As per the commit(d4b23c5c434a) message
"devm_thermal_zone_of_sensor_register() case doesn't need to
call thermal_zone_device_unregister()"

We are not using devm version of thermal_zone_of_sensor_register, so I
guess the below commit is not required.
d4b23c5c434a ("thermal: rcar_thermal: don't call
thermal_zone_device_unregister when USE_OF_THERMAL")
Even so, it is wrong to use thermal_zone_of_sensor_register() and then
thermal_zone_device_unregister().

It looks like this was fixed upstream by commits 5e325868aa59
("thermal: convert rcar_thermal to use
devm_thermal_zone_of_sensor_register") and d4b23c5c434a ("thermal:
rcar_thermal: don't call thermal_zone_device_unregister when
USE_OF_THERMAL").
The commit 5e325868aa59 ("thermal: convert rcar_thermal to use
devm_thermal_zone_of_sensor_register")
depend upon the commit e498b4984 ("thermal: of-thermal: Add devm
version of thermal_zone_of_sensor_register") which is outside the scope
of renesas thermal driver.

Are you ok for backporting the above patch? If yes, then it make sense to
backport the commits 5e325868aa59 and d4b23c5c434a.

Yes, I think this is OK. Commit e498b4984 doesn't change any existing
functions so it should be safe to add.
Shall I send only thermal related patches or do you want me to send V2 with 65 patches?
Please let me know.

Regards,
Biju



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


Re: [PATCH 4/7] ARM: dts: iwg20d-q7-dbcm-ca: Add HDMI video output

Ben Hutchings <ben.hutchings@...>
 

On Wed, 2018-05-30 at 15:58 +0000, Fabrizio Castro wrote:
Hi Ben,

Thank you for your feedback.

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings@...]
Sent: 30 May 2018 16:46
To: Fabrizio Castro <fabrizio.castro@...>
Cc: cip-dev@...; Chris Paterson <Chris.Paterson2@...>; Biju Das <biju.das@...>
Subject: Re: [cip-dev][PATCH 4/7] ARM: dts: iwg20d-q7-dbcm-ca: Add HDMI video output

On Tue, 2018-05-15 at 12:19 +0100, Fabrizio Castro wrote:
Although there is a HDMI connector on the q7 carrier board it is not
connected to the RZ/G1M SoC. One must use the HDMI connector on the
camera daughter board.

This patch adds support for this connector.

Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...>
Signed-off-by: Simon Horman <horms+renesas@...>
(cherry picked from commit 55cce0a07678e5fe21c7f81cc437653b485a712c)
(taken out interrupt support)
Why is that?  Is it a limitation of the GPIO driver in 4.4?
From the cover letter this patch belongs to:
[...]

Oops, sorry, I must remember to read the cover letter first.

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


Re: [PATCH 4/7] ARM: dts: iwg20d-q7-dbcm-ca: Add HDMI video output

Fabrizio Castro <fabrizio.castro@...>
 

Hi Ben,

Thank you for your feedback.

-----Original Message-----
From: Ben Hutchings [mailto:ben.hutchings@...]
Sent: 30 May 2018 16:46
To: Fabrizio Castro <fabrizio.castro@...>
Cc: cip-dev@...; Chris Paterson <Chris.Paterson2@...>; Biju Das <biju.das@...>
Subject: Re: [cip-dev][PATCH 4/7] ARM: dts: iwg20d-q7-dbcm-ca: Add HDMI video output

On Tue, 2018-05-15 at 12:19 +0100, Fabrizio Castro wrote:
Although there is a HDMI connector on the q7 carrier board it is not
connected to the RZ/G1M SoC. One must use the HDMI connector on the
camera daughter board.

This patch adds support for this connector.

Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...>
Signed-off-by: Simon Horman <horms+renesas@...>
(cherry picked from commit 55cce0a07678e5fe21c7f81cc437653b485a712c)
(taken out interrupt support)
Why is that? Is it a limitation of the GPIO driver in 4.4?
From the cover letter this patch belongs to:
" I had to take out interrupt (hotplug) support from the hdmi DT node as
it looks like commit 9183e45db7774716d056319c237a4185baba19c7 introduced
"connector" data field with struct adv7511, but drm_connector_init was
left behind, and as such connector.dev is NULL, and that causes issues
to function adv7511_hpd_work, preventing HDMI hotplug from working
properly.

While investigating HDMI hotplugging, I have found out that when using
a GPIO purely as an interrupt source the corresponding GPIO module
clock is not enabled, therefore this series backports the fix for this.
I yet have to check if this fix is any good to 4.4 LTS, I'll send it to
stable@... in case it works for 4.4 LTS too."

I have dropped the fix for the gpio driver from this series (patches 6 and 7), and I have reworked it to make it suitable for 4.4 stable, and I have sent it to Greg (he has taken it already).
You were in copy in the email to Greg, I guess you will get to it at some point later today.
We are going to leave HDMI hotplugging disabled for now as the HDMI transmitter driver needs proper fixing, and we don't have time for this just now.

Thanks,
Fab


Ben.

Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
[...]

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


Re: [PATCH 4/7] ARM: dts: iwg20d-q7-dbcm-ca: Add HDMI video output

Ben Hutchings <ben.hutchings@...>
 

On Tue, 2018-05-15 at 12:19 +0100, Fabrizio Castro wrote:
Although there is a HDMI connector on the q7 carrier board it is not
connected to the RZ/G1M SoC. One must use the HDMI connector on the
camera daughter board.

This patch adds support for this connector.

Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...>
Signed-off-by: Simon Horman <horms+renesas@...>
(cherry picked from commit 55cce0a07678e5fe21c7f81cc437653b485a712c)
(taken out interrupt support)
Why is that? Is it a limitation of the GPIO driver in 4.4?

Ben.

Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
[...]

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


Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone on DT

Ben Hutchings <ben.hutchings@...>
 

On Mon, 2018-05-21 at 13:46 +0000, Biju Das wrote:
Hi Ben,

Thanks for the feedback.

Subject: Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone on DT

On Thu, 2018-05-10 at 16:08 +0100, Biju Das wrote:
From: Kuninori Morimoto <kuninori.morimoto.gx@...>

This patch enables to use thermal-zone on DT if it was calles as
"renesas,rcar-thermal-gen2".
Previous style (= non thermal-zone) is still supported by
"renesas,rcar-thermal" to keep compatibility for "git bisect".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...>
Signed-off-by: Eduardo Valentin <edubezval@...> (cherry picked
from commit 8b477ea56383dc8b838f1f8b506e4571c14ceb30)
Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Fabrizio Castro <fabrizio.castro@...>
[...]
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
[...]
@@ -463,7 +492,13 @@ static int rcar_thermal_probe(struct
platform_device *pdev)
 if (ret < 0)
 goto error_unregister;

-priv->zone = thermal_zone_device_register("rcar_thermal",
+if (of_data == USE_OF_THERMAL)
+priv->zone = thermal_zone_of_sensor_register(
+dev, i, priv,
+
&rcar_thermal_zone_of_ops);

Doesn't this require a corresponding change to use
thermal_zone_of_sensor_unregister()?
As per  the commit(d4b23c5c434a) message "devm_thermal_zone_of_sensor_register() case doesn't need to call   thermal_zone_device_unregister()"

We are not using devm version of thermal_zone_of_sensor_register, so  I guess the below commit is not required.
d4b23c5c434a ("thermal: rcar_thermal: don't call thermal_zone_device_unregister when USE_OF_THERMAL")
Even so, it is wrong to use thermal_zone_of_sensor_register() and then
thermal_zone_device_unregister().

It looks like this was fixed upstream by commits 5e325868aa59
("thermal: convert rcar_thermal to use
devm_thermal_zone_of_sensor_register") and d4b23c5c434a ("thermal:
rcar_thermal: don't call thermal_zone_device_unregister when
USE_OF_THERMAL").
The commit 5e325868aa59 ("thermal: convert rcar_thermal to use devm_thermal_zone_of_sensor_register")
depend upon the commit e498b4984 ("thermal: of-thermal: Add devm version of  thermal_zone_of_sensor_register")
which is outside the scope of renesas thermal driver.

 Are you ok for backporting the above patch? If yes, then it make sense to backport the commits 5e325868aa59 and d4b23c5c434a.
Yes, I think this is OK. Commit e498b4984 doesn't change any existing
functions so it should be safe to add.

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


[PATCH] ARM: dts: r8a7743: Add VSP support

Fabrizio Castro <fabrizio.castro@...>
 

From: Biju Das <biju.das@...>

Add VSP support to SoC DT.

Signed-off-by: Biju Das <biju.das@...>
(cherry picked from commit ff9b22610e8c08946f9787d9e0d1a87489624417)
(dropped resets property. changed clocks and power-domains properties.
added vsp device configuration)
Signed-off-by: Fabrizio Castro <fabrizio.castro@...>
Reviewed-by: Biju Das <biju.das@...>
---
Hello Ben,

this patch applies on top of v4.4.130-cip23.

Thanks,
Fab

arch/arm/boot/dts/r8a7743.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index eb3cdc8..e8082f8 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -1330,6 +1330,48 @@
};
};

+ vsp@fe928000 {
+ compatible = "renesas,vsp1";
+ reg = <0 0xfe928000 0 0x8000>;
+ interrupts = <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp1_clks R8A7743_CLK_VSP1_S>;
+ power-domains = <&cpg_clocks>;
+
+ renesas,has-lut;
+ renesas,has-sru;
+ renesas,#rpf = <5>;
+ renesas,#uds = <3>;
+ renesas,#wpf = <4>;
+ };
+
+ vsp@fe930000 {
+ compatible = "renesas,vsp1";
+ reg = <0 0xfe930000 0 0x8000>;
+ interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp1_clks R8A7743_CLK_VSP1_DU0>;
+ power-domains = <&cpg_clocks>;
+
+ renesas,has-lif;
+ renesas,has-lut;
+ renesas,#rpf = <4>;
+ renesas,#uds = <1>;
+ renesas,#wpf = <4>;
+ };
+
+ vsp@fe938000 {
+ compatible = "renesas,vsp1";
+ reg = <0 0xfe938000 0 0x8000>;
+ interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp1_clks R8A7743_CLK_VSP1_DU1>;
+ power-domains = <&cpg_clocks>;
+
+ renesas,has-lif;
+ renesas,has-lut;
+ renesas,#rpf = <4>;
+ renesas,#uds = <1>;
+ renesas,#wpf = <4>;
+ };
+
pci0: pci@ee090000 {
compatible = "renesas,pci-r8a7743",
"renesas,pci-rcar-gen2";
--
2.7.4


Re: B@D and the iwg20m

Agustín Benito Bethencourt <agustin.benito@...>
 

Hi Robert,

can you open a ticket to track this effort?

Best Regards


--
Agustín Benito Bethencourt
Principal Consultant
Codethink Ltd
We respect your privacy. See https://www.codethink.co.uk/privacy.html


[ANNOUNCE] 4.4.130-cip23-rt18

Daniel Wagner <wagi@...>
 

Hello CIP RT Folks!

I'm pleased to announce the 4.4.130-cip23-rt18 stable release.

This release is just an update to the new Linux 4.4.130-cip23
version and no RT specific changes have been made.

You can get this release via the git tree at:

git://git.kernel.org/pub/scm/linux/kernel/git/wagi/linux-cip-rt.git

branch: linux-4.4.y-cip-rt
Head SHA1: 4a1665b8f06c96c77465c5797ff1549bed4a68c8

Enjoy!
Daniel


Memorial Day: May 28

Jeff ErnstFriedman <jernstfriedman@...>
 

Due to the Memorial Day holiday in the US, I will not be available for the Monday May 28 TSC meeting.

However please indicate if there are any action items you would like me to followup on and I will get to them ASAP.

Thank you.

Jeff ErnstFriedman
2201 Broadway #604, Oakland, CA 94612
mobile: 510.593.1367
skype: jeffrey.ernstfriedman
twitter: @namdeirf


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

Biju Das <biju.das@...>
 

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

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

Signed-off-by: Geert Uytterhoeven <geert+renesas@...>
Signed-off-by: Simon Horman <horms+renesas@...>
(cherry picked from commit 6161cc147277e7537d73a45d732a7112997c20f6)
(enabled only USB-DMAC apart from previously enabled CAN and
CAN_RCAR)
Signed-off-by: Biju Das <biju.das@...>
---
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


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

Biju Das <biju.das@...>
 

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

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@...>
Signed-off-by: Vinod Koul <vinod.koul@...>
(cherry picked from commit d9f5efade2cfd729138a7cafb46d01044da40f5e)
Signed-off-by: Biju Das <biju.das@...>
---
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


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

Biju Das <biju.das@...>
 

From: Dmitry Osipenko <digetx@...>

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@...>
Signed-off-by: Felipe Balbi <felipe.balbi@...>
(cherry picked from commit 0852659ef071ccd84e85e37195e7c2f3e7c64d1f)
Signed-off-by: Biju Das <biju.das@...>
---
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


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

Biju Das <biju.das@...>
 

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

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@...>
Signed-off-by: Felipe Balbi <felipe.balbi@...>
(cherry picked from commit ee5acabf5805612c72084276e0c215367a042d71)
Signed-off-by: Biju Das <biju.das@...>
---
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


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

Biju Das <biju.das@...>
 

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

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@...>
Signed-off-by: Felipe Balbi <felipe.balbi@...>
(cherry picked from commit c4824f11fe07835c63209fb035f03f8f82e12827)
Signed-off-by: Biju Das <biju.das@...>
---
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


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

Biju Das <biju.das@...>
 

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

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@...>
Signed-off-by: Felipe Balbi <felipe.balbi@...>
(cherry picked from commit 05f6b0ff68429bb7c6b84b35e71b522c3bae76ae)
Signed-off-by: Biju Das <biju.das@...>
---
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


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

Biju Das <biju.das@...>
 

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

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@...>
Signed-off-by: Felipe Balbi <felipe.balbi@...>
(cherry picked from commit 60e7396f820fa67a007f2a2eb5d97d3e77a74881)
Signed-off-by: Biju Das <biju.das@...>
---
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


[RFC PATCH 0/7] 'SKB reserve' quirk setup to u_ether

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

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

8341 - 8360 of 9573