* [PATCH v2 11/18] drm/sun4i: Add A83T support
From: Jernej Škrabec @ 2017-12-02 21:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171130153312.plmh2wr4n5njhlvb@flea.lan>
Dne ?etrtek, 30. november 2017 ob 16:33:12 CET je Maxime Ripard napisal(a):
> On Tue, Nov 28, 2017 at 11:33:44PM +0100, Jernej ?krabec wrote:
> > Hi!
> >
> > Dne torek, 28. november 2017 ob 23:00:14 CET je Maxime Ripard napisal(a):
> > > On Tue, Nov 28, 2017 at 04:48:55PM +0100, Jernej ?krabec wrote:
> > > > > On Mon, Nov 27, 2017 at 05:01:49PM +0100, Jernej ?krabec wrote:
> > > > > > Dne ponedeljek, 27. november 2017 ob 16:41:35 CET je Maxime Ripard
> > > >
> > > > napisal(a):
> > > > > > > Add support for the A83T display pipeline.
> > > > > > >
> > > > > > > Reviewed-by: Chen-Yu Tsai <wens@csie.org>
> > > > > > > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > > > > > > ---
> > > > > > >
> > > > > > > Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt |
> > > > > > > 3
> > > > > > > +++
> > > > > > > drivers/gpu/drm/sun4i/sun4i_drv.c |
> > > > > > > 2
> > > > > > > ++
> > > > > > > drivers/gpu/drm/sun4i/sun4i_tcon.c |
> > > > > > > 5
> > > > > > > +++++
> > > > > > > drivers/gpu/drm/sun4i/sun8i_mixer.c |
> > > > > > > 4
> > > > > > > ++++
> > > > > > > 4 files changed, 14 insertions(+)
> > > > > > >
> > > > > > > diff --git
> > > > > > > a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> > > > > > > b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> > > > > > > index
> > > > > > > d4259a4f5171..d6b52e5c48c0 100644
> > > > > > > ---
> > > > > > > a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> > > > > > > +++
> > > > > > > b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> > > > > > >
> > > > > > > @@ -93,6 +93,7 @@ Required properties:
> > > > > > > * allwinner,sun6i-a31s-tcon
> > > > > > > * allwinner,sun7i-a20-tcon
> > > > > > > * allwinner,sun8i-a33-tcon
> > > > > > >
> > > > > > > + * allwinner,sun8i-a83t-tcon-lcd
> > > > > > >
> > > > > > > * allwinner,sun8i-v3s-tcon
> > > > > > >
> > > > > > > - reg: base address and size of memory-mapped region
> > > > > > > - interrupts: interrupt associated to this IP
> > > > > > >
> > > > > > > @@ -224,6 +225,7 @@ supported.
> > > > > > >
> > > > > > > Required properties:
> > > > > > > - compatible: value must be one of:
> > > > > > > + * allwinner,sun8i-a83t-de2-mixer
> > > > > >
> > > > > > What will be the name of the second mixer, once support for HDMI
> > > > > > is
> > > > > > added?
> > > > > > Should we start directly with 0 and 1 postfix ?
> > > > >
> > > > > What are the differences exactly without the two mixers?
> > > >
> > > > Mixer properties:
> > > > - mixer index (0 or 1), important for determining CCSC base (see my
> > > > patches)
> > >
> > > Is that the only thing we need to determine?
> >
> > For now, mixer index is important only for determining CCSC base in
> > conjuction with VEP capability. Obviously, I can't exclude that there is
> > some other case where that mixer index is needed.
>
> That's unfortunate...
I take a deeper look today about that issue and it seems that mixer index is
really needed only here. I did only regex search and not line by line check,
so take this with grain of salt.
Additionally, it seems that this comparison is kind of a hack for V3s. Channel
output CSC is done through VEP (video enhancement processor, maybe?) unit.
Those units are only on VI channels. But every SoC with DE2 I checked except
V3s have 1 VI channel and VEP enabled on first mixer. V3s on the other hand
have 2 VI channels and no VEP, but same addresses should work for channel
output CSC according to the code. Of course, that is only a theory, but if you
want, we can go with quirks structure. Or better yet, with quirk property,
since there may be some (future?) SoC with two mixers and no VEP unit
supported.
BTW, how should be DE3 on H6 handled in the future? Registers offsets seems to
be same within same DE2 and DE3 units, just extended. However, some base
addresses are different, for example, those connected to VEP. I don't think
new driver is needed, just some quirks structure which would tell DE version.
Best regards,
Jernej
>
> > Can't we just add reg property for that?
>
> No, reg is here specifically for the bus address, not for an index,
> and in general, indices are poorly perceived and have been subject to
> a lot of debate in the past. Hence why I'd really like to avoid any
> solution looking like this. But I guess we don't really have the
> choice either.
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
^ permalink raw reply
* [alsa-devel] [PATCH 1/2] dt-bindings: trivial: add tfa9879 device
From: Fabio Estevam @ 2017-12-02 21:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171201224425.5477-2-peda@axentia.se>
On Fri, Dec 1, 2017 at 8:44 PM, Peter Rosin <peda@axentia.se> wrote:
> Add record for NXP TFA9879 Mono BTL Class D audio amplifier.
>
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
> Documentation/devicetree/bindings/trivial-devices.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/trivial-devices.txt b/Documentation/devicetree/bindings/trivial-devices.txt
> index af284fbd4d23..4cf30ce4e71f 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.txt
> +++ b/Documentation/devicetree/bindings/trivial-devices.txt
> @@ -157,6 +157,7 @@ nxp,pcf2127 Real-time clock
> nxp,pcf2129 Real-time clock
> nxp,pcf8563 Real-time clock/calendar
> nxp,pcf85063 Tiny Real-Time Clock
> +nxp,tfa9879 Mono BTL Class D audio amplifier
This is already described at Documentation/devicetree/bindings/sound/tfa9879.txt
^ permalink raw reply
* [PATCH 08/10] net: fjes: Handle return value of platform_get_irq and platform_get_resource
From: arvindY @ 2017-12-02 20:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1bbebd1a-4cca-0ef0-bdc1-ae50a4218f30@cogentembedded.com>
Hi Sergei,
On Sunday 03 December 2017 01:36 AM, Sergei Shtylyov wrote:
> Hello!
>
> On 12/02/2017 10:26 PM, Arvind Yadav wrote:
>
>> platform_get_irq() and platform_get_resource() can fail here and
>> we must check its return value.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> drivers/net/fjes/fjes_main.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
>> index 750954b..540dd51 100644
>> --- a/drivers/net/fjes/fjes_main.c
>> +++ b/drivers/net/fjes/fjes_main.c
>> @@ -1265,9 +1265,19 @@ static int fjes_probe(struct platform_device
>> *plat_dev)
>> adapter->interrupt_watch_enable = false;
>> res = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
>> + if (!res) {
>> + err = -EINVAL;
>> + goto err_free_netdev;
>> + }
>> +
>> hw->hw_res.start = res->start;
>> hw->hw_res.size = resource_size(res);
>> hw->hw_res.irq = platform_get_irq(plat_dev, 0);
>> + if (hw->hw_res.irq <= 0) {
>
> This function no longer returns 0 on error, no need to check for <= 0.
>
>> + err = hw->hw_res.irq ? hw->hw_res.irq : -ENODEV;
>> + goto err_free_netdev;
>
> gcc allows a shorter way to write that.
>
> err = hw->hw_res.irq ?: -ENODEV;
Yes, you are right, But first is more readable. That's why I have used.
>
>> + }
>> +
>> err = fjes_hw_init(&adapter->hw);
>> if (err)
>> goto err_free_netdev;
>
> MBR, Sergei
Thanks,
~arvind
^ permalink raw reply
* [PATCH 2/2] ARM: dts: imx51-babbage: Fix the 26MHz clock modelling
From: Fabio Estevam @ 2017-12-02 20:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512246365-3657-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@nxp.com>
On imx51-babbage there is a 26MHz oscillator that is gated by GPIO3_1.
The output of this clock feeds audio codec clock and USB PHY clocks,
which are gated by GPIO4_26 and GPIO2_1 respectively.
Fix the clock representation by properly using gpio-gate-clock.
The clock nodes can be moved out of the 'clocks' node.
Based on a commit from Lucas Stach for imx51-zii-rdu1 board.
This also fixes the following build warning with W=1:
arch/arm/boot/dts/imx51-babbage.dtb: Warning (unit_address_vs_reg): Node /clocks/codec_clock has a reg or ranges property, but no unit name
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx51-babbage.dts | 67 +++++++++++++++++++++++++++----------
1 file changed, 50 insertions(+), 17 deletions(-)
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index c432de7..663a3cd 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -25,18 +25,41 @@
reg = <0x90000000 0x20000000>;
};
- clocks {
- ckih1 {
- clock-frequency = <22579200>;
- };
+ ckih1 {
+ clock-frequency = <22579200>;
+ };
- clk_26M: codec_clock {
- compatible = "fixed-clock";
- reg=<0>;
- #clock-cells = <0>;
- clock-frequency = <26000000>;
- gpios = <&gpio4 26 GPIO_ACTIVE_LOW>;
- };
+ clk_26M_osc: 26M_osc {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <26000000>;
+ };
+
+ clk_26M_osc_gate: 26M_gate {
+ compatible = "gpio-gate-clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_clk26mhz_osc>;
+ clocks = <&clk_26M_osc>;
+ #clock-cells = <0>;
+ enable-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
+ };
+
+ clk_26M_audio: audio_gate {
+ compatible = "gpio-gate-clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_clk26mhz_audio>;
+ clocks = <&clk_26M_osc_gate>;
+ #clock-cells = <0>;
+ enable-gpios = <&gpio4 26 GPIO_ACTIVE_LOW>;
+ };
+
+ clk_26M_usb: usbhost_gate {
+ compatible = "gpio-gate-clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_clk26mhz_usb>;
+ clocks = <&clk_26M_osc_gate>;
+ #clock-cells = <0>;
+ enable-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
};
display1: disp1 {
@@ -162,7 +185,7 @@
usbh1phy: usbh1phy at 0 {
compatible = "usb-nop-xceiv";
reg = <0>;
- clocks = <&clks IMX5_CLK_DUMMY>;
+ clocks = <&clk_26M_usb>;
clock-names = "main_clk";
reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
vcc-supply = <&vusb_reg>;
@@ -345,10 +368,8 @@
sgtl5000: codec at a {
compatible = "fsl,sgtl5000";
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_clkcodec>;
reg = <0x0a>;
- clocks = <&clk_26M>;
+ clocks = <&clk_26M_audio>;
VDDA-supply = <&vdig_reg>;
VDDIO-supply = <&vvideo_reg>;
};
@@ -441,9 +462,21 @@
>;
};
- pinctrl_clkcodec: clkcodecgrp {
+ pinctrl_clk26mhz_audio: clk26mhzaudiocgrp {
+ fsl,pins = <
+ MX51_PAD_CSPI1_RDY__GPIO4_26 0x85
+ >;
+ };
+
+ pinctrl_clk26mhz_osc: clk26mhzoscgrp {
+ fsl,pins = <
+ MX51_PAD_DI1_PIN12__GPIO3_1 0x85
+ >;
+ };
+
+ pinctrl_clk26mhz_usb: clk26mhzusbgrp {
fsl,pins = <
- MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000
+ MX51_PAD_EIM_D17__GPIO2_1 0x85
>;
};
--
2.7.4
^ permalink raw reply related
* [PATCH 1/2] ARM: dts: imx51-babbage: Pass the USB PHY regulator
From: Fabio Estevam @ 2017-12-02 20:26 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@nxp.com>
The USB PHYs are supplied via MC13892 VUSB regulator rail,
so properly describe this in the device tree.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx51-babbage.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index c4aa53c..c432de7 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -165,6 +165,7 @@
clocks = <&clks IMX5_CLK_DUMMY>;
clock-names = "main_clk";
reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
+ vcc-supply = <&vusb_reg>;
#phy-cells = <0>;
};
};
@@ -241,6 +242,10 @@
regulator-max-microvolt = <3150000>;
};
+ vusb_reg: vusb {
+ regulator-boot-on;
+ };
+
vusb2_reg: vusb2 {
regulator-min-microvolt = <2400000>;
regulator-max-microvolt = <2775000>;
@@ -414,6 +419,10 @@
status = "okay";
};
+&usbphy0 {
+ vcc-supply = <&vusb_reg>;
+};
+
&usbotg {
dr_mode = "otg";
disable-over-current;
--
2.7.4
^ permalink raw reply related
* [PATCH 05/10] net: ethernet: i825xx: Fix platform_get_irq's error checking
From: arvindY @ 2017-12-02 20:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <2b23637d-0d19-4a6a-4e67-e64968f85415@cogentembedded.com>
Hi Sergei,
On Sunday 03 December 2017 01:38 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 12/02/2017 10:26 PM, Arvind Yadav wrote:
>
>> The platform_get_irq() function returns negative if an error occurs.
>> zero or positive number on success. platform_get_irq() error checking
>> for zero is not correct.
>
> The why you consider returning 0 a sign of failure?
Here, Returning 0 is a problem. Because IRQ0 is always a problem.
This function is for getting an IRQ for a device. So we should check for
0 also.
>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> drivers/net/ethernet/i825xx/sni_82596.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/i825xx/sni_82596.c
>> b/drivers/net/ethernet/i825xx/sni_82596.c
>> index b2c04a7..a6d56f5 100644
>> --- a/drivers/net/ethernet/i825xx/sni_82596.c
>> +++ b/drivers/net/ethernet/i825xx/sni_82596.c
>> @@ -120,9 +120,10 @@ static int sni_82596_probe(struct
>> platform_device *dev)
>> netdevice->dev_addr[5] = readb(eth_addr + 0x06);
>> iounmap(eth_addr);
>> - if (!netdevice->irq) {
>> + if (netdevice->irq <= 0) {
>> printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n",
>> __FILE__, netdevice->base_addr);
>> + retval = netdevice->irq ? netdevice->irq : -ENODEV;
>> goto probe_failed;
>> }
>
> MBR, Sergei
~arvind
^ permalink raw reply
* [PATCH 05/10] net: ethernet: i825xx: Fix platform_get_irq's error checking
From: Sergei Shtylyov @ 2017-12-02 20:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-6-git-send-email-arvind.yadav.cs@gmail.com>
Hello.
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
> The platform_get_irq() function returns negative if an error occurs.
> zero or positive number on success. platform_get_irq() error checking
> for zero is not correct.
The why you consider returning 0 a sign of failure?
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/net/ethernet/i825xx/sni_82596.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/i825xx/sni_82596.c b/drivers/net/ethernet/i825xx/sni_82596.c
> index b2c04a7..a6d56f5 100644
> --- a/drivers/net/ethernet/i825xx/sni_82596.c
> +++ b/drivers/net/ethernet/i825xx/sni_82596.c
> @@ -120,9 +120,10 @@ static int sni_82596_probe(struct platform_device *dev)
> netdevice->dev_addr[5] = readb(eth_addr + 0x06);
> iounmap(eth_addr);
>
> - if (!netdevice->irq) {
> + if (netdevice->irq <= 0) {
> printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n",
> __FILE__, netdevice->base_addr);
> + retval = netdevice->irq ? netdevice->irq : -ENODEV;
> goto probe_failed;
> }
>
MBR, Sergei
^ permalink raw reply
* [PATCH 07/10] net: ethernet: smsc: Handle return value of platform_get_irq
From: Sergei Shtylyov @ 2017-12-02 20:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-8-git-send-email-arvind.yadav.cs@gmail.com>
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
> platform_get_irq() can fail here and we must check its return value.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/net/ethernet/smsc/smc911x.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
> index 0515744..a1cf18c 100644
> --- a/drivers/net/ethernet/smsc/smc911x.c
> +++ b/drivers/net/ethernet/smsc/smc911x.c
> @@ -2088,6 +2088,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
>
> ndev->dma = (unsigned char)-1;
> ndev->irq = platform_get_irq(pdev, 0);
> + if (ndev->irq <= 0) {
> + ret = ndev->irq ? ndev->irq : -ENODEV;
Same comments as the next patch...
> + goto release_both;
> + }
> +
> lp = netdev_priv(ndev);
> lp->netdev = ndev;
> #ifdef SMC_DYNAMIC_BUS_CONFIG
MBR, Sergei
^ permalink raw reply
* [PATCH 08/10] net: fjes: Handle return value of platform_get_irq and platform_get_resource
From: Sergei Shtylyov @ 2017-12-02 20:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-9-git-send-email-arvind.yadav.cs@gmail.com>
Hello!
On 12/02/2017 10:26 PM, Arvind Yadav wrote:
> platform_get_irq() and platform_get_resource() can fail here and
> we must check its return value.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/net/fjes/fjes_main.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
> index 750954b..540dd51 100644
> --- a/drivers/net/fjes/fjes_main.c
> +++ b/drivers/net/fjes/fjes_main.c
> @@ -1265,9 +1265,19 @@ static int fjes_probe(struct platform_device *plat_dev)
> adapter->interrupt_watch_enable = false;
>
> res = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
> + if (!res) {
> + err = -EINVAL;
> + goto err_free_netdev;
> + }
> +
> hw->hw_res.start = res->start;
> hw->hw_res.size = resource_size(res);
> hw->hw_res.irq = platform_get_irq(plat_dev, 0);
> + if (hw->hw_res.irq <= 0) {
This function no longer returns 0 on error, no need to check for <= 0.
> + err = hw->hw_res.irq ? hw->hw_res.irq : -ENODEV;
> + goto err_free_netdev;
gcc allows a shorter way to write that.
err = hw->hw_res.irq ?: -ENODEV;
> + }
> +
> err = fjes_hw_init(&adapter->hw);
> if (err)
> goto err_free_netdev;
MBR, Sergei
^ permalink raw reply
* [PATCH 10/10] net: ethernet: cpmac: Handle return value of platform_get_irq_byname
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq_byname() can fail here and we must check its return
value
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/ti/cpmac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 9b8a30b..f3acfc0 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1124,6 +1124,10 @@ static int cpmac_probe(struct platform_device *pdev)
}
dev->irq = platform_get_irq_byname(pdev, "irq");
+ if (dev->irq < 0) {
+ rc = dev->irq;
+ goto fail;
+ }
dev->netdev_ops = &cpmac_netdev_ops;
dev->ethtool_ops = &cpmac_ethtool_ops;
--
2.7.4
^ permalink raw reply related
* [PATCH 09/10] net: ethernet: korina: Handle return value of platform_get_irq_byname
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq_byname() can fail here and we must check its return
value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/korina.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index ae195f8..e778504 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -1039,7 +1039,16 @@ static int korina_probe(struct platform_device *pdev)
memcpy(dev->dev_addr, bif->mac, ETH_ALEN);
lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx");
+ if (lp->rx_irq < 0) {
+ rc = lp->rx_irq;
+ goto probe_err_out;
+ }
+
lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx");
+ if (lp->tx_irq < 0) {
+ rc = lp->tx_irq;
+ goto probe_err_out;
+ }
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs");
dev->base_addr = r->start;
--
2.7.4
^ permalink raw reply related
* [PATCH 08/10] net: fjes: Handle return value of platform_get_irq and platform_get_resource
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq() and platform_get_resource() can fail here and
we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/fjes/fjes_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index 750954b..540dd51 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1265,9 +1265,19 @@ static int fjes_probe(struct platform_device *plat_dev)
adapter->interrupt_watch_enable = false;
res = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
+ if (!res) {
+ err = -EINVAL;
+ goto err_free_netdev;
+ }
+
hw->hw_res.start = res->start;
hw->hw_res.size = resource_size(res);
hw->hw_res.irq = platform_get_irq(plat_dev, 0);
+ if (hw->hw_res.irq <= 0) {
+ err = hw->hw_res.irq ? hw->hw_res.irq : -ENODEV;
+ goto err_free_netdev;
+ }
+
err = fjes_hw_init(&adapter->hw);
if (err)
goto err_free_netdev;
--
2.7.4
^ permalink raw reply related
* [PATCH 07/10] net: ethernet: smsc: Handle return value of platform_get_irq
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/smsc/smc911x.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 0515744..a1cf18c 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -2088,6 +2088,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
ndev->dma = (unsigned char)-1;
ndev->irq = platform_get_irq(pdev, 0);
+ if (ndev->irq <= 0) {
+ ret = ndev->irq ? ndev->irq : -ENODEV;
+ goto release_both;
+ }
+
lp = netdev_priv(ndev);
lp->netdev = ndev;
#ifdef SMC_DYNAMIC_BUS_CONFIG
--
2.7.4
^ permalink raw reply related
* [PATCH 06/10] net: ethernet: natsemi: Handle return value of platform_get_irq
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/natsemi/jazzsonic.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index d5b2888..3cf0856 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -242,6 +242,11 @@ static int jazz_sonic_probe(struct platform_device *pdev)
dev->base_addr = res->start;
dev->irq = platform_get_irq(pdev, 0);
+ if (dev->irq <= 0) {
+ err = dev->irq ? dev->irq : -ENODEV;
+ goto out;
+ }
+
err = sonic_probe1(dev);
if (err)
goto out;
--
2.7.4
^ permalink raw reply related
* [PATCH 05/10] net: ethernet: i825xx: Fix platform_get_irq's error checking
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/i825xx/sni_82596.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/i825xx/sni_82596.c b/drivers/net/ethernet/i825xx/sni_82596.c
index b2c04a7..a6d56f5 100644
--- a/drivers/net/ethernet/i825xx/sni_82596.c
+++ b/drivers/net/ethernet/i825xx/sni_82596.c
@@ -120,9 +120,10 @@ static int sni_82596_probe(struct platform_device *dev)
netdevice->dev_addr[5] = readb(eth_addr + 0x06);
iounmap(eth_addr);
- if (!netdevice->irq) {
+ if (netdevice->irq <= 0) {
printk(KERN_ERR "%s: IRQ not found for i82596@0x%lx\n",
__FILE__, netdevice->base_addr);
+ retval = netdevice->irq ? netdevice->irq : -ENODEV;
goto probe_failed;
}
--
2.7.4
^ permalink raw reply related
* [PATCH 04/10] can: xilinx: Handle return value of platform_get_irq
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/can/xilinx_can.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 89aec07..e36e2a2 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -1111,6 +1111,10 @@ static int xcan_probe(struct platform_device *pdev)
/* Get IRQ for the device */
ndev->irq = platform_get_irq(pdev, 0);
+ if (ndev->irq <= 0) {
+ ret = ndev->irq ? ndev->irq : -ENODEV;
+ goto err_free;
+ }
ndev->flags |= IFF_ECHO; /* We support local echo */
platform_set_drvdata(pdev, ndev);
--
2.7.4
^ permalink raw reply related
* [PATCH 03/10] net: ezchip: nps_enet: Fix platform_get_irq's error checking
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct. And remove unnecessary check for free_netdev().
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
index 659f1ad..82dc6d0 100644
--- a/drivers/net/ethernet/ezchip/nps_enet.c
+++ b/drivers/net/ethernet/ezchip/nps_enet.c
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)
/* Get IRQ number */
priv->irq = platform_get_irq(pdev, 0);
- if (!priv->irq) {
+ if (priv->irq <= 0) {
dev_err(dev, "failed to retrieve <irq Rx-Tx> value from device tree\n");
- err = -ENODEV;
+ err = priv->irq ? priv->irq : -ENODEV;
goto out_netdev;
}
@@ -646,8 +646,7 @@ static s32 nps_enet_probe(struct platform_device *pdev)
out_netif_api:
netif_napi_del(&priv->napi);
out_netdev:
- if (err)
- free_netdev(ndev);
+ free_netdev(ndev);
return err;
}
--
2.7.4
^ permalink raw reply related
* [PATCH 02/10] net: bcmgenet: free netdev on of_match_node() error
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
The change is to call free_netdev(), If of_match_node() will fail.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index e2f1268..e0a8f79 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3363,8 +3363,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
if (dn) {
of_id = of_match_node(bcmgenet_match, dn);
- if (!of_id)
- return -EINVAL;
+ if (!of_id) {
+ err = -EINVAL;
+ goto err;
+ }
}
priv = netdev_priv(dev);
--
2.7.4
^ permalink raw reply related
* [PATCH 01/10] net: bcmgenet: Fix platform_get_irq's error checking
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com>
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 24b4f4c..e2f1268 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3371,7 +3371,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
priv->irq0 = platform_get_irq(pdev, 0);
priv->irq1 = platform_get_irq(pdev, 1);
priv->wol_irq = platform_get_irq(pdev, 2);
- if (!priv->irq0 || !priv->irq1) {
+ if (priv->irq0 <= 0 || priv->irq1 <= 0 || priv->wol_irq <= 0) {
dev_err(&pdev->dev, "can't find IRQs\n");
err = -EINVAL;
goto err;
--
2.7.4
^ permalink raw reply related
* [PATCH 00/10] Handle return value of platform_get_*
From: Arvind Yadav @ 2017-12-02 19:26 UTC (permalink / raw)
To: linux-arm-kernel
- The platform_get_*_*() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq_byname() error
checking for zero is not correct.
- The change is to call free_netdev(), If of_match_node() will fail.
- Handle return value of platform_get_resource()
Arvind Yadav (10):
[PATCH 01/10] net: bcmgenet: Fix platform_get_irq's error checking
[PATCH 02/10] net: bcmgenet: free netdev on of_match_node() error
[PATCH 03/10] net: ezchip: nps_enet: Fix platform_get_irq's error checking
[PATCH 04/10] can: xilinx: Handle return value of platform_get_irq
[PATCH 05/10] net: ethernet: i825xx: Fix platform_get_irq's error checking
[PATCH 06/10] net: ethernet: natsemi: Handle return value of platform_get_irq
[PATCH 07/10] net: ethernet: smsc: Handle return value of platform_get_irq
[PATCH 08/10] net: fjes: Handle return value of platform_get_irq and platform_get_resource
[PATCH 09/10] net: ethernet: korina: Handle return value of platform_get_irq_byname
[PATCH 10/10] net: ethernet: cpmac: Handle return value of platform_get_irq_byname
drivers/net/can/xilinx_can.c | 4 ++++
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++++---
drivers/net/ethernet/ezchip/nps_enet.c | 7 +++----
drivers/net/ethernet/i825xx/sni_82596.c | 3 ++-
drivers/net/ethernet/korina.c | 9 +++++++++
drivers/net/ethernet/natsemi/jazzsonic.c | 5 +++++
drivers/net/ethernet/smsc/smc911x.c | 5 +++++
drivers/net/ethernet/ti/cpmac.c | 4 ++++
drivers/net/fjes/fjes_main.c | 10 ++++++++++
9 files changed, 47 insertions(+), 8 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH 1/1] timecounter: Make cyclecounter struct part of timecounter struct
From: Richard Cochran @ 2017-12-02 18:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1512189095-28654-1-git-send-email-sagar.a.kamble@intel.com>
On Sat, Dec 02, 2017 at 10:01:35AM +0530, Sagar Arun Kamble wrote:
> There is no real need for the users of timecounters to define cyclecounter
> and timecounter variables separately. Since timecounter will always be
> based on cyclecounter, have cyclecounter struct as member of timecounter
> struct.
Overall, this is a welcome change. However, it doesn't go far enough,
IMHO, and I'll explain that more below.
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
> index 0247885..35987b5 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
...
As it stands now, timecounter_init() is used for two totally different
reasons. Some callers only want to set the time, ...
> @@ -207,7 +207,7 @@ static int mlx4_en_phc_settime(struct ptp_clock_info *ptp,
>
> /* reset the timecounter */
> write_seqlock_irqsave(&mdev->clock_lock, flags);
> - timecounter_init(&mdev->clock, &mdev->cycles, ns);
> + timecounter_init(&mdev->clock, ns);
> write_sequnlock_irqrestore(&mdev->clock_lock, flags);
>
> return 0;
... while others initialize the data structure the first time:
> @@ -274,17 +274,17 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
>
> seqlock_init(&mdev->clock_lock);
>
> - memset(&mdev->cycles, 0, sizeof(mdev->cycles));
> - mdev->cycles.read = mlx4_en_read_clock;
> - mdev->cycles.mask = CLOCKSOURCE_MASK(48);
> - mdev->cycles.shift = freq_to_shift(dev->caps.hca_core_clock);
> - mdev->cycles.mult =
> - clocksource_khz2mult(1000 * dev->caps.hca_core_clock, mdev->cycles.shift);
> - mdev->nominal_c_mult = mdev->cycles.mult;
> + memset(&mdev->clock.cc, 0, sizeof(mdev->clock.cc));
> + mdev->clock.cc.read = mlx4_en_read_clock;
> + mdev->clock.cc.mask = CLOCKSOURCE_MASK(48);
> + mdev->clock.cc.shift = freq_to_shift(dev->caps.hca_core_clock);
> + mdev->clock.cc.mult =
> + clocksource_khz2mult(1000 * dev->caps.hca_core_clock,
> + mdev->clock.cc.shift);
> + mdev->nominal_c_mult = mdev->clock.cc.mult;
>
> write_seqlock_irqsave(&mdev->clock_lock, flags);
> - timecounter_init(&mdev->clock, &mdev->cycles,
> - ktime_to_ns(ktime_get_real()));
> + timecounter_init(&mdev->clock, ktime_to_ns(ktime_get_real()));
I'd like to see two followup patches to this one:
1. Convert timecounter_init() callers to a new timecounter_reset()
function where the intent is to reset the time.
2. Change timecounter_init() to take the cyclecounter fields as
arguments.
void timecounter_init(struct timecounter *tc,
u64 (*read)(const struct cyclecounter *cc),
u64 mask,
u32 mult,
u32 shift,
u64 start_tstamp);
Then we can clean up all this stuff:
mdev->clock.cc.read = mlx4_en_read_clock;
mdev->clock.cc.mask = CLOCKSOURCE_MASK(48);
mdev->clock.cc.shift = freq_to_shift(dev->caps.hca_core_clock);
mdev->clock.cc.mult = clocksource_khz2mult(...);
This second step can be phased in by calling the new function
timecounter_initialize() and converting the drivers one by one.
> diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h
> index 2496ad4..6daca06 100644
> --- a/include/linux/timecounter.h
> +++ b/include/linux/timecounter.h
...
> @@ -98,7 +98,6 @@ static inline void timecounter_adjtime(struct timecounter *tc, s64 delta)
> /**
> * timecounter_init - initialize a time counter
> * @tc: Pointer to time counter which is to be initialized/reset
> - * @cc: A cycle counter, ready to be used.
This "ready to used" requirement should go. The init() function
should make the instance ready to be used all at once.
Thanks,
Richard
^ permalink raw reply
* [PATCH] ARM: dts: imx6qdl-zii-rdu2: Remove device_type from PCI subnode
From: Fabio Estevam @ 2017-12-02 17:08 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@nxp.com>
device_type = "pci" should be used for the SoC level PCI controller and
it is already present at imx6qdl.dtsi.
Remove it from the subnode in order to fix the following build
warnings with W=1:
arch/arm/boot/dts/imx6q-zii-rdu2.dtb: Warning (pci_bridge): Node /soc/pcie at 1ffc000/pci at 0 missing ranges for PCI bridge (or not a bridge)
arch/arm/boot/dts/imx6q-zii-rdu2.dtb: Warning (pci_bridge): Node /soc/pcie at 1ffc000/pci at 0 missing bus-range for PCI bridge
arch/arm/boot/dts/imx6q-zii-rdu2.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge'
arch/arm/boot/dts/imx6q-zii-rdu2.dtb: Warning (pci_device_reg): Failed prerequisite 'pci_bridge'
arch/arm/boot/dts/imx6q-zii-rdu2.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge'
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 5ea9949..72f52fc 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -584,7 +584,6 @@
host at 0 {
reg = <0 0 0 0 0>;
- device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
--
2.7.4
^ permalink raw reply related
* [PATCH] pinctrl: pxa2xx: add MODULE_LICENSE
From: Linus Walleij @ 2017-12-02 16:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171202094015.11696-1-dja@axtens.net>
On Sat, Dec 2, 2017 at 10:40 AM, Daniel Axtens <dja@axtens.net> wrote:
> This fixes the following warning on an allmodconfig build:
> WARNING: modpost: missing MODULE_LICENSE() in drivers/pinctrl/pxa/pinctrl-pxa2xx.o
>
> This matches the license in the header.
>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
Somebody patches this too. Sorry!
Thanks anyway!
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH v4 00/10] add pinmuxing support for pins in AXP209 and AXP813 PMICs
From: Linus Walleij @ 2017-12-02 16:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <cover.3ff63fdf302c6bda02ea7d160ad2aa5afee0899d.1512135804.git-series.quentin.schulz@free-electrons.com>
On Fri, Dec 1, 2017 at 2:44 PM, Quentin Schulz
<quentin.schulz@free-electrons.com> wrote:
> The AXP209 and AXP813 PMICs have several pins (respectively 3 and 2) that can
> be used either as GPIOs or for other purposes (ADC or LDO here).
>
> We already have a GPIO driver for the GPIO use of those pins on the AXP209.
> Let's "upgrade" this driver to support all the functions these pins can have.
>
> Then we add support to this driver for the AXP813 which is slighlty different
> (basically a different offset in two registers and one less pin).
>
> I suggest patches 1 to 8 go through Linus's tree and 9 and 10 via Maxime or
> Chen-Yu's tree.
>
> v4:
Looks overall good. As soon as Maxime is happy with everything I will
happily apply 1-8 to the pinctrl tree and then pull it to GPIO as well to
avoid clashes.
I think there were some minor comments but it seems almost finished.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH v4 09/10] ARM: dtsi: axp81x: add GPIO DT node
From: Linus Walleij @ 2017-12-02 15:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <af90c57ebf97c8f5504a4b5b1dad3638bedadfef.1512135804.git-series.quentin.schulz@free-electrons.com>
On Fri, Dec 1, 2017 at 2:44 PM, Quentin Schulz
<quentin.schulz@free-electrons.com> wrote:
> This adds DT node for the GPIO/pinctrl part present in AXP813/AXP818.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Please apply this through ARM SoC.
Yours,
Linus Walleij
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox