All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-09-02 14:43 ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 14:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-arm-kernel, linux-kernel

This patch series fixes regression introduced in commit 366697018c9a
("PCI: aardvark: Add PHY support") which caused aardvark driver
initialization failure on EspressoBin board with factory version of
Arm Trusted Firmware provided by Marvell.

Second patch depends on the first patch, so please add appropriate
Fixes/Cc:stable@ tags to have both patches correctly backported to
stable kernels.

I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
and with upstream ATF+uboot and aardvark was initialized successfully.
Without this patch series on ebin-17.10-uart.zip aardvark initialization
failed.

Pali Rohár (2):
  phy: marvell: comphy: Convert internal SMCC firmware return codes to
    errno
  PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
    Firmware

 drivers/pci/controller/pci-aardvark.c        |  4 +++-
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
 drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
 3 files changed, 25 insertions(+), 7 deletions(-)

-- 
2.20.1


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

* [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-09-02 14:43 ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 14:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-kernel, linux-arm-kernel

This patch series fixes regression introduced in commit 366697018c9a
("PCI: aardvark: Add PHY support") which caused aardvark driver
initialization failure on EspressoBin board with factory version of
Arm Trusted Firmware provided by Marvell.

Second patch depends on the first patch, so please add appropriate
Fixes/Cc:stable@ tags to have both patches correctly backported to
stable kernels.

I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
and with upstream ATF+uboot and aardvark was initialized successfully.
Without this patch series on ebin-17.10-uart.zip aardvark initialization
failed.

Pali Rohár (2):
  phy: marvell: comphy: Convert internal SMCC firmware return codes to
    errno
  PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
    Firmware

 drivers/pci/controller/pci-aardvark.c        |  4 +++-
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
 drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
 3 files changed, 25 insertions(+), 7 deletions(-)

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 14:43 ` Pali Rohár
@ 2020-09-02 14:43   ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 14:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-arm-kernel, linux-kernel

Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
return codes to phy caller. This patch converts SMCC error codes to
standard linux errno codes. Include file linux/arm-smccc.h already provides
defines for SMCC error codes, so use them instead of custom driver defines.
Note that return value is signed 32bit, but stored in unsigned long type
with zero padding.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
 drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
index 1a138be8bd6a..810f25a47632 100644
--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
@@ -26,7 +26,6 @@
 #define COMPHY_SIP_POWER_ON			0x82000001
 #define COMPHY_SIP_POWER_OFF			0x82000002
 #define COMPHY_SIP_PLL_LOCK			0x82000003
-#define COMPHY_FW_NOT_SUPPORTED			(-1)
 
 #define COMPHY_FW_MODE_SATA			0x1
 #define COMPHY_FW_MODE_SGMII			0x2
@@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane,
 				  unsigned long mode)
 {
 	struct arm_smccc_res res;
+	s32 ret;
 
 	arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res);
+	ret = res.a0;
 
-	return res.a0;
+	switch (ret) {
+	case SMCCC_RET_SUCCESS:
+		return 0;
+	case SMCCC_RET_NOT_SUPPORTED:
+		return -EOPNOTSUPP;
+	default:
+		return -EINVAL;
+	}
 }
 
 static int mvebu_a3700_comphy_get_fw_mode(int lane, int port,
@@ -220,7 +228,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy)
 	}
 
 	ret = mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param);
-	if (ret == COMPHY_FW_NOT_SUPPORTED)
+	if (ret == -EOPNOTSUPP)
 		dev_err(lane->dev,
 			"unsupported SMC call, try updating your firmware\n");
 
diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
index e41367f36ee1..53ad127b100f 100644
--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
@@ -123,7 +123,6 @@
 
 #define COMPHY_SIP_POWER_ON	0x82000001
 #define COMPHY_SIP_POWER_OFF	0x82000002
-#define COMPHY_FW_NOT_SUPPORTED	(-1)
 
 /*
  * A lane is described by the following bitfields:
@@ -273,10 +272,19 @@ static int mvebu_comphy_smc(unsigned long function, unsigned long phys,
 			    unsigned long lane, unsigned long mode)
 {
 	struct arm_smccc_res res;
+	s32 ret;
 
 	arm_smccc_smc(function, phys, lane, mode, 0, 0, 0, 0, &res);
+	ret = res.a0;
 
-	return res.a0;
+	switch (ret) {
+	case SMCCC_RET_SUCCESS:
+		return 0;
+	case SMCCC_RET_NOT_SUPPORTED:
+		return -EOPNOTSUPP;
+	default:
+		return -EINVAL;
+	}
 }
 
 static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port,
@@ -819,7 +827,7 @@ static int mvebu_comphy_power_on(struct phy *phy)
 	if (!ret)
 		return ret;
 
-	if (ret == COMPHY_FW_NOT_SUPPORTED)
+	if (ret == -EOPNOTSUPP)
 		dev_err(priv->dev,
 			"unsupported SMC call, try updating your firmware\n");
 
-- 
2.20.1


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

* [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 14:43   ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 14:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-kernel, linux-arm-kernel

Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
return codes to phy caller. This patch converts SMCC error codes to
standard linux errno codes. Include file linux/arm-smccc.h already provides
defines for SMCC error codes, so use them instead of custom driver defines.
Note that return value is signed 32bit, but stored in unsigned long type
with zero padding.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
 drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
index 1a138be8bd6a..810f25a47632 100644
--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
@@ -26,7 +26,6 @@
 #define COMPHY_SIP_POWER_ON			0x82000001
 #define COMPHY_SIP_POWER_OFF			0x82000002
 #define COMPHY_SIP_PLL_LOCK			0x82000003
-#define COMPHY_FW_NOT_SUPPORTED			(-1)
 
 #define COMPHY_FW_MODE_SATA			0x1
 #define COMPHY_FW_MODE_SGMII			0x2
@@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane,
 				  unsigned long mode)
 {
 	struct arm_smccc_res res;
+	s32 ret;
 
 	arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res);
+	ret = res.a0;
 
-	return res.a0;
+	switch (ret) {
+	case SMCCC_RET_SUCCESS:
+		return 0;
+	case SMCCC_RET_NOT_SUPPORTED:
+		return -EOPNOTSUPP;
+	default:
+		return -EINVAL;
+	}
 }
 
 static int mvebu_a3700_comphy_get_fw_mode(int lane, int port,
@@ -220,7 +228,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy)
 	}
 
 	ret = mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param);
-	if (ret == COMPHY_FW_NOT_SUPPORTED)
+	if (ret == -EOPNOTSUPP)
 		dev_err(lane->dev,
 			"unsupported SMC call, try updating your firmware\n");
 
diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
index e41367f36ee1..53ad127b100f 100644
--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
@@ -123,7 +123,6 @@
 
 #define COMPHY_SIP_POWER_ON	0x82000001
 #define COMPHY_SIP_POWER_OFF	0x82000002
-#define COMPHY_FW_NOT_SUPPORTED	(-1)
 
 /*
  * A lane is described by the following bitfields:
@@ -273,10 +272,19 @@ static int mvebu_comphy_smc(unsigned long function, unsigned long phys,
 			    unsigned long lane, unsigned long mode)
 {
 	struct arm_smccc_res res;
+	s32 ret;
 
 	arm_smccc_smc(function, phys, lane, mode, 0, 0, 0, 0, &res);
+	ret = res.a0;
 
-	return res.a0;
+	switch (ret) {
+	case SMCCC_RET_SUCCESS:
+		return 0;
+	case SMCCC_RET_NOT_SUPPORTED:
+		return -EOPNOTSUPP;
+	default:
+		return -EINVAL;
+	}
 }
 
 static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port,
@@ -819,7 +827,7 @@ static int mvebu_comphy_power_on(struct phy *phy)
 	if (!ret)
 		return ret;
 
-	if (ret == COMPHY_FW_NOT_SUPPORTED)
+	if (ret == -EOPNOTSUPP)
 		dev_err(priv->dev,
 			"unsupported SMC call, try updating your firmware\n");
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
  2020-09-02 14:43 ` Pali Rohár
@ 2020-09-02 14:43   ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 14:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-arm-kernel, linux-kernel

Old ATF automatically power on pcie phy and does not provide SMC call for
phy power on functionality which leads to aardvark initialization failure:

[    0.330134] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware
[    0.338846] phy phy-d0018300.phy.1: phy poweron failed --> -95
[    0.344753] advk-pcie d0070000.pcie: Failed to initialize PHY (-95)
[    0.351160] advk-pcie: probe of d0070000.pcie failed with error -95

This patch fixes above failure by ignoring 'not supported' error in
aardvark driver. In this case it is expected that phy is already power on.

Signed-off-by: Pali Rohár <pali@kernel.org>
Fixes: 366697018c9a ("PCI: aardvark: Add PHY support")
---
 drivers/pci/controller/pci-aardvark.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index c5d1bb3d52e4..e1a80c35c73d 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -1108,7 +1108,9 @@ static int advk_pcie_enable_phy(struct advk_pcie *pcie)
 	}
 
 	ret = phy_power_on(pcie->phy);
-	if (ret) {
+	if (ret == -EOPNOTSUPP) {
+		dev_warn(&pcie->pdev->dev, "PHY unsupported by firmware\n");
+	} else if (ret) {
 		phy_exit(pcie->phy);
 		return ret;
 	}
-- 
2.20.1


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

* [PATCH 2/2] PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
@ 2020-09-02 14:43   ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 14:43 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-kernel, linux-arm-kernel

Old ATF automatically power on pcie phy and does not provide SMC call for
phy power on functionality which leads to aardvark initialization failure:

[    0.330134] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware
[    0.338846] phy phy-d0018300.phy.1: phy poweron failed --> -95
[    0.344753] advk-pcie d0070000.pcie: Failed to initialize PHY (-95)
[    0.351160] advk-pcie: probe of d0070000.pcie failed with error -95

This patch fixes above failure by ignoring 'not supported' error in
aardvark driver. In this case it is expected that phy is already power on.

Signed-off-by: Pali Rohár <pali@kernel.org>
Fixes: 366697018c9a ("PCI: aardvark: Add PHY support")
---
 drivers/pci/controller/pci-aardvark.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index c5d1bb3d52e4..e1a80c35c73d 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -1108,7 +1108,9 @@ static int advk_pcie_enable_phy(struct advk_pcie *pcie)
 	}
 
 	ret = phy_power_on(pcie->phy);
-	if (ret) {
+	if (ret == -EOPNOTSUPP) {
+		dev_warn(&pcie->pdev->dev, "PHY unsupported by firmware\n");
+	} else if (ret) {
 		phy_exit(pcie->phy);
 		return ret;
 	}
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 14:43   ` Pali Rohár
@ 2020-09-02 16:13     ` Andrew Lunn
  -1 siblings, 0 replies; 44+ messages in thread
From: Andrew Lunn @ 2020-09-02 16:13 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-kernel, linux-arm-kernel

On Wed, Sep 02, 2020 at 04:43:43PM +0200, Pali Rohár wrote:
> Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
> return codes to phy caller. This patch converts SMCC error codes to
> standard linux errno codes. Include file linux/arm-smccc.h already provides
> defines for SMCC error codes, so use them instead of custom driver defines.
> Note that return value is signed 32bit, but stored in unsigned long type
> with zero padding.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  2 files changed, 22 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> index 1a138be8bd6a..810f25a47632 100644
> --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> @@ -26,7 +26,6 @@
>  #define COMPHY_SIP_POWER_ON			0x82000001
>  #define COMPHY_SIP_POWER_OFF			0x82000002
>  #define COMPHY_SIP_PLL_LOCK			0x82000003
> -#define COMPHY_FW_NOT_SUPPORTED			(-1)
>  
>  #define COMPHY_FW_MODE_SATA			0x1
>  #define COMPHY_FW_MODE_SGMII			0x2
> @@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane,
>  				  unsigned long mode)
>  {
>  	struct arm_smccc_res res;
> +	s32 ret;
>  
>  	arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res);
> +	ret = res.a0;
>  
> -	return res.a0;

> +	switch (ret) {
> +	case SMCCC_RET_SUCCESS:
> +		return 0;
> +	case SMCCC_RET_NOT_SUPPORTED:
> +		return -EOPNOTSUPP;
> +	default:
> +		return -EINVAL;
> +	}
>  }

Hi Pali

Maybe this should be a global helper translating SMCCC_RET_* into a
standard errno value?

	 Andrew

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 16:13     ` Andrew Lunn
  0 siblings, 0 replies; 44+ messages in thread
From: Andrew Lunn @ 2020-09-02 16:13 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, Lorenzo Pieralisi, linux-pci,
	linux-kernel, Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal,
	Bjorn Helgaas, Marek Behún, linux-arm-kernel

On Wed, Sep 02, 2020 at 04:43:43PM +0200, Pali Rohár wrote:
> Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
> return codes to phy caller. This patch converts SMCC error codes to
> standard linux errno codes. Include file linux/arm-smccc.h already provides
> defines for SMCC error codes, so use them instead of custom driver defines.
> Note that return value is signed 32bit, but stored in unsigned long type
> with zero padding.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  2 files changed, 22 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> index 1a138be8bd6a..810f25a47632 100644
> --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> @@ -26,7 +26,6 @@
>  #define COMPHY_SIP_POWER_ON			0x82000001
>  #define COMPHY_SIP_POWER_OFF			0x82000002
>  #define COMPHY_SIP_PLL_LOCK			0x82000003
> -#define COMPHY_FW_NOT_SUPPORTED			(-1)
>  
>  #define COMPHY_FW_MODE_SATA			0x1
>  #define COMPHY_FW_MODE_SGMII			0x2
> @@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane,
>  				  unsigned long mode)
>  {
>  	struct arm_smccc_res res;
> +	s32 ret;
>  
>  	arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res);
> +	ret = res.a0;
>  
> -	return res.a0;

> +	switch (ret) {
> +	case SMCCC_RET_SUCCESS:
> +		return 0;
> +	case SMCCC_RET_NOT_SUPPORTED:
> +		return -EOPNOTSUPP;
> +	default:
> +		return -EINVAL;
> +	}
>  }

Hi Pali

Maybe this should be a global helper translating SMCCC_RET_* into a
standard errno value?

	 Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 16:13     ` Andrew Lunn
@ 2020-09-02 16:56       ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 16:56 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-kernel, linux-arm-kernel

On Wednesday 02 September 2020 18:13:28 Andrew Lunn wrote:
> On Wed, Sep 02, 2020 at 04:43:43PM +0200, Pali Rohár wrote:
> > Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
> > return codes to phy caller. This patch converts SMCC error codes to
> > standard linux errno codes. Include file linux/arm-smccc.h already provides
> > defines for SMCC error codes, so use them instead of custom driver defines.
> > Note that return value is signed 32bit, but stored in unsigned long type
> > with zero padding.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > ---
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> >  2 files changed, 22 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> > index 1a138be8bd6a..810f25a47632 100644
> > --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> > +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> > @@ -26,7 +26,6 @@
> >  #define COMPHY_SIP_POWER_ON			0x82000001
> >  #define COMPHY_SIP_POWER_OFF			0x82000002
> >  #define COMPHY_SIP_PLL_LOCK			0x82000003
> > -#define COMPHY_FW_NOT_SUPPORTED			(-1)
> >  
> >  #define COMPHY_FW_MODE_SATA			0x1
> >  #define COMPHY_FW_MODE_SGMII			0x2
> > @@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane,
> >  				  unsigned long mode)
> >  {
> >  	struct arm_smccc_res res;
> > +	s32 ret;
> >  
> >  	arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res);
> > +	ret = res.a0;
> >  
> > -	return res.a0;
> 
> > +	switch (ret) {
> > +	case SMCCC_RET_SUCCESS:
> > +		return 0;
> > +	case SMCCC_RET_NOT_SUPPORTED:
> > +		return -EOPNOTSUPP;
> > +	default:
> > +		return -EINVAL;
> > +	}
> >  }
> 
> Hi Pali
> 
> Maybe this should be a global helper translating SMCCC_RET_* into a
> standard errno value?
> 
> 	 Andrew

Hello Andrew!

Well, I'm not sure if some standard global helper is the correct way for
marvell comphy handler. It returns 0 for success and -1 on error when
handler is not supported.

Generic SMCC helper would need to support also other values which are
defined/used by SMCC. And I'm not sure if some helpers cannot define and
use also non-standard codecs.

I think that such generic helper would need larger discussion and aim of
these patches is to fix PCIe support on Armada 3720 HW which is broken
since mentioned commit when users use factory firmware. So patches could
be easily backported to stable kernels.

On Espressobin is kernel stored on uSD card, so updating it is simple
and easy -- as opposite of updating ATF firmware which is stored in SPI.

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 16:56       ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 16:56 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Tomasz Maciej Nowak, Rob Herring, Lorenzo Pieralisi, linux-pci,
	linux-kernel, Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal,
	Bjorn Helgaas, Marek Behún, linux-arm-kernel

On Wednesday 02 September 2020 18:13:28 Andrew Lunn wrote:
> On Wed, Sep 02, 2020 at 04:43:43PM +0200, Pali Rohár wrote:
> > Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
> > return codes to phy caller. This patch converts SMCC error codes to
> > standard linux errno codes. Include file linux/arm-smccc.h already provides
> > defines for SMCC error codes, so use them instead of custom driver defines.
> > Note that return value is signed 32bit, but stored in unsigned long type
> > with zero padding.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > ---
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> >  2 files changed, 22 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> > index 1a138be8bd6a..810f25a47632 100644
> > --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> > +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> > @@ -26,7 +26,6 @@
> >  #define COMPHY_SIP_POWER_ON			0x82000001
> >  #define COMPHY_SIP_POWER_OFF			0x82000002
> >  #define COMPHY_SIP_PLL_LOCK			0x82000003
> > -#define COMPHY_FW_NOT_SUPPORTED			(-1)
> >  
> >  #define COMPHY_FW_MODE_SATA			0x1
> >  #define COMPHY_FW_MODE_SGMII			0x2
> > @@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane,
> >  				  unsigned long mode)
> >  {
> >  	struct arm_smccc_res res;
> > +	s32 ret;
> >  
> >  	arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res);
> > +	ret = res.a0;
> >  
> > -	return res.a0;
> 
> > +	switch (ret) {
> > +	case SMCCC_RET_SUCCESS:
> > +		return 0;
> > +	case SMCCC_RET_NOT_SUPPORTED:
> > +		return -EOPNOTSUPP;
> > +	default:
> > +		return -EINVAL;
> > +	}
> >  }
> 
> Hi Pali
> 
> Maybe this should be a global helper translating SMCCC_RET_* into a
> standard errno value?
> 
> 	 Andrew

Hello Andrew!

Well, I'm not sure if some standard global helper is the correct way for
marvell comphy handler. It returns 0 for success and -1 on error when
handler is not supported.

Generic SMCC helper would need to support also other values which are
defined/used by SMCC. And I'm not sure if some helpers cannot define and
use also non-standard codecs.

I think that such generic helper would need larger discussion and aim of
these patches is to fix PCIe support on Armada 3720 HW which is broken
since mentioned commit when users use factory firmware. So patches could
be easily backported to stable kernels.

On Espressobin is kernel stored on uSD card, so updating it is simple
and easy -- as opposite of updating ATF firmware which is stored in SPI.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 16:56       ` Pali Rohár
@ 2020-09-02 17:00         ` Andrew Lunn
  -1 siblings, 0 replies; 44+ messages in thread
From: Andrew Lunn @ 2020-09-02 17:00 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-kernel, linux-arm-kernel

> > > +	switch (ret) {
> > > +	case SMCCC_RET_SUCCESS:
> > > +		return 0;
> > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > +		return -EOPNOTSUPP;
> > > +	default:
> > > +		return -EINVAL;
> > > +	}
> > >  }
> > 
> > Hi Pali
> > 
> > Maybe this should be a global helper translating SMCCC_RET_* into a
> > standard errno value?
> > 
> > 	 Andrew
> 
> Hello Andrew!
> 
> Well, I'm not sure if some standard global helper is the correct way for
> marvell comphy handler. It returns 0 for success and -1 on error when
> handler is not supported.

No, i was meaning just 

switch (ret) {
case SMCCC_RET_SUCCESS:
	return 0;
case SMCCC_RET_NOT_SUPPORTED:
	return -EOPNOTSUPP;
default:
	return -EINVAL;
}

There is nothing Marvell specific here.

      Andrew

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 17:00         ` Andrew Lunn
  0 siblings, 0 replies; 44+ messages in thread
From: Andrew Lunn @ 2020-09-02 17:00 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, Lorenzo Pieralisi, linux-pci,
	linux-kernel, Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal,
	Bjorn Helgaas, Marek Behún, linux-arm-kernel

> > > +	switch (ret) {
> > > +	case SMCCC_RET_SUCCESS:
> > > +		return 0;
> > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > +		return -EOPNOTSUPP;
> > > +	default:
> > > +		return -EINVAL;
> > > +	}
> > >  }
> > 
> > Hi Pali
> > 
> > Maybe this should be a global helper translating SMCCC_RET_* into a
> > standard errno value?
> > 
> > 	 Andrew
> 
> Hello Andrew!
> 
> Well, I'm not sure if some standard global helper is the correct way for
> marvell comphy handler. It returns 0 for success and -1 on error when
> handler is not supported.

No, i was meaning just 

switch (ret) {
case SMCCC_RET_SUCCESS:
	return 0;
case SMCCC_RET_NOT_SUPPORTED:
	return -EOPNOTSUPP;
default:
	return -EINVAL;
}

There is nothing Marvell specific here.

      Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 17:00         ` Andrew Lunn
@ 2020-09-02 17:05           ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 17:05 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-kernel, linux-arm-kernel

On Wednesday 02 September 2020 19:00:10 Andrew Lunn wrote:
> > > > +	switch (ret) {
> > > > +	case SMCCC_RET_SUCCESS:
> > > > +		return 0;
> > > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > > +		return -EOPNOTSUPP;
> > > > +	default:
> > > > +		return -EINVAL;
> > > > +	}
> > > >  }
> > > 
> > > Hi Pali
> > > 
> > > Maybe this should be a global helper translating SMCCC_RET_* into a
> > > standard errno value?
> > > 
> > > 	 Andrew
> > 
> > Hello Andrew!
> > 
> > Well, I'm not sure if some standard global helper is the correct way for
> > marvell comphy handler. It returns 0 for success and -1 on error when
> > handler is not supported.
> 
> No, i was meaning just 
> 
> switch (ret) {
> case SMCCC_RET_SUCCESS:
> 	return 0;
> case SMCCC_RET_NOT_SUPPORTED:
> 	return -EOPNOTSUPP;
> default:
> 	return -EINVAL;
> }

But this is not a complete generic helper. There are more generic SMCC
return codes and generic helper should define and translate all of them.

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 17:05           ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 17:05 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Tomasz Maciej Nowak, Rob Herring, Lorenzo Pieralisi, linux-pci,
	linux-kernel, Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal,
	Bjorn Helgaas, Marek Behún, linux-arm-kernel

On Wednesday 02 September 2020 19:00:10 Andrew Lunn wrote:
> > > > +	switch (ret) {
> > > > +	case SMCCC_RET_SUCCESS:
> > > > +		return 0;
> > > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > > +		return -EOPNOTSUPP;
> > > > +	default:
> > > > +		return -EINVAL;
> > > > +	}
> > > >  }
> > > 
> > > Hi Pali
> > > 
> > > Maybe this should be a global helper translating SMCCC_RET_* into a
> > > standard errno value?
> > > 
> > > 	 Andrew
> > 
> > Hello Andrew!
> > 
> > Well, I'm not sure if some standard global helper is the correct way for
> > marvell comphy handler. It returns 0 for success and -1 on error when
> > handler is not supported.
> 
> No, i was meaning just 
> 
> switch (ret) {
> case SMCCC_RET_SUCCESS:
> 	return 0;
> case SMCCC_RET_NOT_SUPPORTED:
> 	return -EOPNOTSUPP;
> default:
> 	return -EINVAL;
> }

But this is not a complete generic helper. There are more generic SMCC
return codes and generic helper should define and translate all of them.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 17:05           ` Pali Rohár
@ 2020-09-02 17:20             ` Andrew Lunn
  -1 siblings, 0 replies; 44+ messages in thread
From: Andrew Lunn @ 2020-09-02 17:20 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-kernel, linux-arm-kernel

On Wed, Sep 02, 2020 at 07:05:25PM +0200, Pali Rohár wrote:
> On Wednesday 02 September 2020 19:00:10 Andrew Lunn wrote:
> > > > > +	switch (ret) {
> > > > > +	case SMCCC_RET_SUCCESS:
> > > > > +		return 0;
> > > > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > > > +		return -EOPNOTSUPP;
> > > > > +	default:
> > > > > +		return -EINVAL;
> > > > > +	}
> > > > >  }
> > > > 
> > > > Hi Pali
> > > > 
> > > > Maybe this should be a global helper translating SMCCC_RET_* into a
> > > > standard errno value?
> > > > 
> > > > 	 Andrew
> > > 
> > > Hello Andrew!
> > > 
> > > Well, I'm not sure if some standard global helper is the correct way for
> > > marvell comphy handler. It returns 0 for success and -1 on error when
> > > handler is not supported.
> > 
> > No, i was meaning just 
> > 
> > switch (ret) {
> > case SMCCC_RET_SUCCESS:
> > 	return 0;
> > case SMCCC_RET_NOT_SUPPORTED:
> > 	return -EOPNOTSUPP;
> > default:
> > 	return -EINVAL;
> > }
> 
> But this is not a complete generic helper. There are more generic SMCC
> return codes and generic helper should define and translate all of them.

/*
 * Return codes defined in ARM DEN 0070A
 * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C
 */
#define SMCCC_RET_SUCCESS			0
#define SMCCC_RET_NOT_SUPPORTED			-1
#define SMCCC_RET_NOT_REQUIRED			-2
#define SMCCC_RET_INVALID_PARAMETER		-3

I only see problems with SMCCC_RET_NOT_REQUIRED and what value to use
for it. Do you have any idea what is actually means? A parameter was
passed which was not required? Or that the call itself is not
required? Looking at the uses of it currently in the kernel, it does
not seem to be an actual error. So maybe just return 0?

	Andrew

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 17:20             ` Andrew Lunn
  0 siblings, 0 replies; 44+ messages in thread
From: Andrew Lunn @ 2020-09-02 17:20 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, Lorenzo Pieralisi, linux-pci,
	linux-kernel, Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal,
	Bjorn Helgaas, Marek Behún, linux-arm-kernel

On Wed, Sep 02, 2020 at 07:05:25PM +0200, Pali Rohár wrote:
> On Wednesday 02 September 2020 19:00:10 Andrew Lunn wrote:
> > > > > +	switch (ret) {
> > > > > +	case SMCCC_RET_SUCCESS:
> > > > > +		return 0;
> > > > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > > > +		return -EOPNOTSUPP;
> > > > > +	default:
> > > > > +		return -EINVAL;
> > > > > +	}
> > > > >  }
> > > > 
> > > > Hi Pali
> > > > 
> > > > Maybe this should be a global helper translating SMCCC_RET_* into a
> > > > standard errno value?
> > > > 
> > > > 	 Andrew
> > > 
> > > Hello Andrew!
> > > 
> > > Well, I'm not sure if some standard global helper is the correct way for
> > > marvell comphy handler. It returns 0 for success and -1 on error when
> > > handler is not supported.
> > 
> > No, i was meaning just 
> > 
> > switch (ret) {
> > case SMCCC_RET_SUCCESS:
> > 	return 0;
> > case SMCCC_RET_NOT_SUPPORTED:
> > 	return -EOPNOTSUPP;
> > default:
> > 	return -EINVAL;
> > }
> 
> But this is not a complete generic helper. There are more generic SMCC
> return codes and generic helper should define and translate all of them.

/*
 * Return codes defined in ARM DEN 0070A
 * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C
 */
#define SMCCC_RET_SUCCESS			0
#define SMCCC_RET_NOT_SUPPORTED			-1
#define SMCCC_RET_NOT_REQUIRED			-2
#define SMCCC_RET_INVALID_PARAMETER		-3

I only see problems with SMCCC_RET_NOT_REQUIRED and what value to use
for it. Do you have any idea what is actually means? A parameter was
passed which was not required? Or that the call itself is not
required? Looking at the uses of it currently in the kernel, it does
not seem to be an actual error. So maybe just return 0?

	Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 17:20             ` Andrew Lunn
@ 2020-09-02 17:45               ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 17:45 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-kernel, linux-arm-kernel

On Wednesday 02 September 2020 19:20:29 Andrew Lunn wrote:
> On Wed, Sep 02, 2020 at 07:05:25PM +0200, Pali Rohár wrote:
> > On Wednesday 02 September 2020 19:00:10 Andrew Lunn wrote:
> > > > > > +	switch (ret) {
> > > > > > +	case SMCCC_RET_SUCCESS:
> > > > > > +		return 0;
> > > > > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > > > > +		return -EOPNOTSUPP;
> > > > > > +	default:
> > > > > > +		return -EINVAL;
> > > > > > +	}
> > > > > >  }
> > > > > 
> > > > > Hi Pali
> > > > > 
> > > > > Maybe this should be a global helper translating SMCCC_RET_* into a
> > > > > standard errno value?
> > > > > 
> > > > > 	 Andrew
> > > > 
> > > > Hello Andrew!
> > > > 
> > > > Well, I'm not sure if some standard global helper is the correct way for
> > > > marvell comphy handler. It returns 0 for success and -1 on error when
> > > > handler is not supported.
> > > 
> > > No, i was meaning just 
> > > 
> > > switch (ret) {
> > > case SMCCC_RET_SUCCESS:
> > > 	return 0;
> > > case SMCCC_RET_NOT_SUPPORTED:
> > > 	return -EOPNOTSUPP;
> > > default:
> > > 	return -EINVAL;
> > > }
> > 
> > But this is not a complete generic helper. There are more generic SMCC
> > return codes and generic helper should define and translate all of them.
> 
> /*
>  * Return codes defined in ARM DEN 0070A
>  * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C
>  */
> #define SMCCC_RET_SUCCESS			0
> #define SMCCC_RET_NOT_SUPPORTED			-1
> #define SMCCC_RET_NOT_REQUIRED			-2
> #define SMCCC_RET_INVALID_PARAMETER		-3

Routines can use also other custom return codes. These are IIRC just
standard defined.

> I only see problems with SMCCC_RET_NOT_REQUIRED and what value to use
> for it. Do you have any idea what is actually means? A parameter was
> passed which was not required? Or that the call itself is not
> required? Looking at the uses of it currently in the kernel, it does
> not seem to be an actual error. So maybe just return 0?

I'm not sure. That is why I wrote that larger discussion about generic
helper is needed. There are for sure people who understand SMC better
and have deep insight.

For Marvell comphy we cannot use return code -2 as success like 0.

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-02 17:45               ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-02 17:45 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Tomasz Maciej Nowak, Rob Herring, Lorenzo Pieralisi, linux-pci,
	linux-kernel, Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal,
	Bjorn Helgaas, Marek Behún, linux-arm-kernel

On Wednesday 02 September 2020 19:20:29 Andrew Lunn wrote:
> On Wed, Sep 02, 2020 at 07:05:25PM +0200, Pali Rohár wrote:
> > On Wednesday 02 September 2020 19:00:10 Andrew Lunn wrote:
> > > > > > +	switch (ret) {
> > > > > > +	case SMCCC_RET_SUCCESS:
> > > > > > +		return 0;
> > > > > > +	case SMCCC_RET_NOT_SUPPORTED:
> > > > > > +		return -EOPNOTSUPP;
> > > > > > +	default:
> > > > > > +		return -EINVAL;
> > > > > > +	}
> > > > > >  }
> > > > > 
> > > > > Hi Pali
> > > > > 
> > > > > Maybe this should be a global helper translating SMCCC_RET_* into a
> > > > > standard errno value?
> > > > > 
> > > > > 	 Andrew
> > > > 
> > > > Hello Andrew!
> > > > 
> > > > Well, I'm not sure if some standard global helper is the correct way for
> > > > marvell comphy handler. It returns 0 for success and -1 on error when
> > > > handler is not supported.
> > > 
> > > No, i was meaning just 
> > > 
> > > switch (ret) {
> > > case SMCCC_RET_SUCCESS:
> > > 	return 0;
> > > case SMCCC_RET_NOT_SUPPORTED:
> > > 	return -EOPNOTSUPP;
> > > default:
> > > 	return -EINVAL;
> > > }
> > 
> > But this is not a complete generic helper. There are more generic SMCC
> > return codes and generic helper should define and translate all of them.
> 
> /*
>  * Return codes defined in ARM DEN 0070A
>  * ARM DEN 0070A is now merged/consolidated into ARM DEN 0028 C
>  */
> #define SMCCC_RET_SUCCESS			0
> #define SMCCC_RET_NOT_SUPPORTED			-1
> #define SMCCC_RET_NOT_REQUIRED			-2
> #define SMCCC_RET_INVALID_PARAMETER		-3

Routines can use also other custom return codes. These are IIRC just
standard defined.

> I only see problems with SMCCC_RET_NOT_REQUIRED and what value to use
> for it. Do you have any idea what is actually means? A parameter was
> passed which was not required? Or that the call itself is not
> required? Looking at the uses of it currently in the kernel, it does
> not seem to be an actual error. So maybe just return 0?

I'm not sure. That is why I wrote that larger discussion about generic
helper is needed. There are for sure people who understand SMC better
and have deep insight.

For Marvell comphy we cannot use return code -2 as success like 0.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-09-02 14:43 ` Pali Rohár
@ 2020-09-16 15:14   ` Tomasz Maciej Nowak
  -1 siblings, 0 replies; 44+ messages in thread
From: Tomasz Maciej Nowak @ 2020-09-16 15:14 UTC (permalink / raw)
  To: Pali Rohár, Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
	Miquel Raynal, Kishon Vijay Abraham I, Vinod Koul,
	Marek Behún
  Cc: linux-pci, linux-arm-kernel, linux-kernel

W dniu 02.09.2020 o 16:43, Pali Rohár pisze:
> This patch series fixes regression introduced in commit 366697018c9a
> ("PCI: aardvark: Add PHY support") which caused aardvark driver
> initialization failure on EspressoBin board with factory version of
> Arm Trusted Firmware provided by Marvell.
> 
> Second patch depends on the first patch, so please add appropriate
> Fixes/Cc:stable@ tags to have both patches correctly backported to
> stable kernels.
> 
> I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> and with upstream ATF+uboot and aardvark was initialized successfully.
> Without this patch series on ebin-17.10-uart.zip aardvark initialization
> failed.
> 
> Pali Rohár (2):
>   phy: marvell: comphy: Convert internal SMCC firmware return codes to
>     errno
>   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
>     Firmware

For both patches

Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>

> 
>  drivers/pci/controller/pci-aardvark.c        |  4 +++-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  3 files changed, 25 insertions(+), 7 deletions(-)
> 


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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-09-16 15:14   ` Tomasz Maciej Nowak
  0 siblings, 0 replies; 44+ messages in thread
From: Tomasz Maciej Nowak @ 2020-09-16 15:14 UTC (permalink / raw)
  To: Pali Rohár, Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
	Miquel Raynal, Kishon Vijay Abraham I, Vinod Koul,
	Marek Behún
  Cc: linux-pci, linux-kernel, linux-arm-kernel

W dniu 02.09.2020 o 16:43, Pali Rohár pisze:
> This patch series fixes regression introduced in commit 366697018c9a
> ("PCI: aardvark: Add PHY support") which caused aardvark driver
> initialization failure on EspressoBin board with factory version of
> Arm Trusted Firmware provided by Marvell.
> 
> Second patch depends on the first patch, so please add appropriate
> Fixes/Cc:stable@ tags to have both patches correctly backported to
> stable kernels.
> 
> I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> and with upstream ATF+uboot and aardvark was initialized successfully.
> Without this patch series on ebin-17.10-uart.zip aardvark initialization
> failed.
> 
> Pali Rohár (2):
>   phy: marvell: comphy: Convert internal SMCC firmware return codes to
>     errno
>   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
>     Firmware

For both patches

Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>

> 
>  drivers/pci/controller/pci-aardvark.c        |  4 +++-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  3 files changed, 25 insertions(+), 7 deletions(-)
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-09-16 15:14   ` Tomasz Maciej Nowak
@ 2020-09-21 13:09     ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-21 13:09 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tomasz Maciej Nowak, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún, linux-pci,
	linux-arm-kernel, linux-kernel

Lorenzo, could you look and review this patch series? It fixes commit
366697018c9a and we would like to have fix also in stable kernels.

On Wednesday 16 September 2020 17:14:02 Tomasz Maciej Nowak wrote:
> W dniu 02.09.2020 o 16:43, Pali Rohár pisze:
> > This patch series fixes regression introduced in commit 366697018c9a
> > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > initialization failure on EspressoBin board with factory version of
> > Arm Trusted Firmware provided by Marvell.
> > 
> > Second patch depends on the first patch, so please add appropriate
> > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > stable kernels.
> > 
> > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > and with upstream ATF+uboot and aardvark was initialized successfully.
> > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > failed.
> > 
> > Pali Rohár (2):
> >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> >     errno
> >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> >     Firmware
> 
> For both patches
> 
> Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
> 
> > 
> >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> >  3 files changed, 25 insertions(+), 7 deletions(-)
> > 
> 

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-09-21 13:09     ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-09-21 13:09 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

Lorenzo, could you look and review this patch series? It fixes commit
366697018c9a and we would like to have fix also in stable kernels.

On Wednesday 16 September 2020 17:14:02 Tomasz Maciej Nowak wrote:
> W dniu 02.09.2020 o 16:43, Pali Rohár pisze:
> > This patch series fixes regression introduced in commit 366697018c9a
> > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > initialization failure on EspressoBin board with factory version of
> > Arm Trusted Firmware provided by Marvell.
> > 
> > Second patch depends on the first patch, so please add appropriate
> > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > stable kernels.
> > 
> > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > and with upstream ATF+uboot and aardvark was initialized successfully.
> > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > failed.
> > 
> > Pali Rohár (2):
> >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> >     errno
> >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> >     Firmware
> 
> For both patches
> 
> Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
> 
> > 
> >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> >  3 files changed, 25 insertions(+), 7 deletions(-)
> > 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  2020-09-02 14:43   ` Pali Rohár
@ 2020-09-30 18:17     ` Rob Herring
  -1 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2020-09-30 18:17 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Kishon Vijay Abraham I, Vinod Koul, Tomasz Maciej Nowak,
	linux-kernel, linux-pci, Miquel Raynal, Lorenzo Pieralisi,
	Marek Behún, Bjorn Helgaas, linux-arm-kernel

On Wed, 02 Sep 2020 16:43:43 +0200, Pali Rohár wrote:
> Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
> return codes to phy caller. This patch converts SMCC error codes to
> standard linux errno codes. Include file linux/arm-smccc.h already provides
> defines for SMCC error codes, so use them instead of custom driver defines.
> Note that return value is signed 32bit, but stored in unsigned long type
> with zero padding.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  2 files changed, 22 insertions(+), 6 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
@ 2020-09-30 18:17     ` Rob Herring
  0 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2020-09-30 18:17 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Lorenzo Pieralisi, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Wed, 02 Sep 2020 16:43:43 +0200, Pali Rohár wrote:
> Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware
> return codes to phy caller. This patch converts SMCC error codes to
> standard linux errno codes. Include file linux/arm-smccc.h already provides
> defines for SMCC error codes, so use them instead of custom driver defines.
> Note that return value is signed 32bit, but stored in unsigned long type
> with zero padding.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  2 files changed, 22 insertions(+), 6 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/2] PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
  2020-09-02 14:43   ` Pali Rohár
@ 2020-09-30 18:17     ` Rob Herring
  -1 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2020-09-30 18:17 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Miquel Raynal, Lorenzo Pieralisi, linux-arm-kernel, Vinod Koul,
	Tomasz Maciej Nowak, Bjorn Helgaas, Marek Behún, linux-pci,
	linux-kernel, Kishon Vijay Abraham I

On Wed, 02 Sep 2020 16:43:44 +0200, Pali Rohár wrote:
> Old ATF automatically power on pcie phy and does not provide SMC call for
> phy power on functionality which leads to aardvark initialization failure:
> 
> [    0.330134] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware
> [    0.338846] phy phy-d0018300.phy.1: phy poweron failed --> -95
> [    0.344753] advk-pcie d0070000.pcie: Failed to initialize PHY (-95)
> [    0.351160] advk-pcie: probe of d0070000.pcie failed with error -95
> 
> This patch fixes above failure by ignoring 'not supported' error in
> aardvark driver. In this case it is expected that phy is already power on.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Fixes: 366697018c9a ("PCI: aardvark: Add PHY support")
> ---
>  drivers/pci/controller/pci-aardvark.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 2/2] PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
@ 2020-09-30 18:17     ` Rob Herring
  0 siblings, 0 replies; 44+ messages in thread
From: Rob Herring @ 2020-09-30 18:17 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Lorenzo Pieralisi, linux-pci, linux-kernel,
	Marek Behún, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Kishon Vijay Abraham I, linux-arm-kernel

On Wed, 02 Sep 2020 16:43:44 +0200, Pali Rohár wrote:
> Old ATF automatically power on pcie phy and does not provide SMC call for
> phy power on functionality which leads to aardvark initialization failure:
> 
> [    0.330134] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware
> [    0.338846] phy phy-d0018300.phy.1: phy poweron failed --> -95
> [    0.344753] advk-pcie d0070000.pcie: Failed to initialize PHY (-95)
> [    0.351160] advk-pcie: probe of d0070000.pcie failed with error -95
> 
> This patch fixes above failure by ignoring 'not supported' error in
> aardvark driver. In this case it is expected that phy is already power on.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Fixes: 366697018c9a ("PCI: aardvark: Add PHY support")
> ---
>  drivers/pci/controller/pci-aardvark.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-09-02 14:43 ` Pali Rohár
@ 2020-10-02 12:00   ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 12:00 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-arm-kernel, linux-kernel

On Wednesday 02 September 2020 16:43:42 Pali Rohár wrote:
> This patch series fixes regression introduced in commit 366697018c9a
> ("PCI: aardvark: Add PHY support") which caused aardvark driver
> initialization failure on EspressoBin board with factory version of
> Arm Trusted Firmware provided by Marvell.
> 
> Second patch depends on the first patch, so please add appropriate
> Fixes/Cc:stable@ tags to have both patches correctly backported to
> stable kernels.
> 
> I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> and with upstream ATF+uboot and aardvark was initialized successfully.
> Without this patch series on ebin-17.10-uart.zip aardvark initialization
> failed.

Lorenzo or Bjorn, could you review this patch series? I would like to
see this regression fixed in stable kernels.

> Pali Rohár (2):
>   phy: marvell: comphy: Convert internal SMCC firmware return codes to
>     errno
>   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
>     Firmware
> 
>  drivers/pci/controller/pci-aardvark.c        |  4 +++-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  3 files changed, 25 insertions(+), 7 deletions(-)
> 
> -- 
> 2.20.1
> 

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 12:00   ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 12:00 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak
  Cc: linux-pci, linux-kernel, linux-arm-kernel

On Wednesday 02 September 2020 16:43:42 Pali Rohár wrote:
> This patch series fixes regression introduced in commit 366697018c9a
> ("PCI: aardvark: Add PHY support") which caused aardvark driver
> initialization failure on EspressoBin board with factory version of
> Arm Trusted Firmware provided by Marvell.
> 
> Second patch depends on the first patch, so please add appropriate
> Fixes/Cc:stable@ tags to have both patches correctly backported to
> stable kernels.
> 
> I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> and with upstream ATF+uboot and aardvark was initialized successfully.
> Without this patch series on ebin-17.10-uart.zip aardvark initialization
> failed.

Lorenzo or Bjorn, could you review this patch series? I would like to
see this regression fixed in stable kernels.

> Pali Rohár (2):
>   phy: marvell: comphy: Convert internal SMCC firmware return codes to
>     errno
>   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
>     Firmware
> 
>  drivers/pci/controller/pci-aardvark.c        |  4 +++-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  3 files changed, 25 insertions(+), 7 deletions(-)
> 
> -- 
> 2.20.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-09-02 14:43 ` Pali Rohár
@ 2020-10-02 13:37   ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 13:37 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> This patch series fixes regression introduced in commit 366697018c9a
> ("PCI: aardvark: Add PHY support") which caused aardvark driver
> initialization failure on EspressoBin board with factory version of
> Arm Trusted Firmware provided by Marvell.
> 
> Second patch depends on the first patch, so please add appropriate
> Fixes/Cc:stable@ tags to have both patches correctly backported to
> stable kernels.
> 
> I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> and with upstream ATF+uboot and aardvark was initialized successfully.
> Without this patch series on ebin-17.10-uart.zip aardvark initialization
> failed.
> 
> Pali Rohár (2):
>   phy: marvell: comphy: Convert internal SMCC firmware return codes to
>     errno
>   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
>     Firmware
> 
>  drivers/pci/controller/pci-aardvark.c        |  4 +++-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  3 files changed, 25 insertions(+), 7 deletions(-)

Applied to pci/aardvark (both patches), thanks.

Lorenzo

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 13:37   ` Lorenzo Pieralisi
  0 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 13:37 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> This patch series fixes regression introduced in commit 366697018c9a
> ("PCI: aardvark: Add PHY support") which caused aardvark driver
> initialization failure on EspressoBin board with factory version of
> Arm Trusted Firmware provided by Marvell.
> 
> Second patch depends on the first patch, so please add appropriate
> Fixes/Cc:stable@ tags to have both patches correctly backported to
> stable kernels.
> 
> I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> and with upstream ATF+uboot and aardvark was initialized successfully.
> Without this patch series on ebin-17.10-uart.zip aardvark initialization
> failed.
> 
> Pali Rohár (2):
>   phy: marvell: comphy: Convert internal SMCC firmware return codes to
>     errno
>   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
>     Firmware
> 
>  drivers/pci/controller/pci-aardvark.c        |  4 +++-
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
>  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
>  3 files changed, 25 insertions(+), 7 deletions(-)

Applied to pci/aardvark (both patches), thanks.

Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 13:37   ` Lorenzo Pieralisi
@ 2020-10-02 14:26     ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 14:26 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > This patch series fixes regression introduced in commit 366697018c9a
> > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > initialization failure on EspressoBin board with factory version of
> > Arm Trusted Firmware provided by Marvell.
> > 
> > Second patch depends on the first patch, so please add appropriate
> > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > stable kernels.
> > 
> > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > and with upstream ATF+uboot and aardvark was initialized successfully.
> > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > failed.
> > 
> > Pali Rohár (2):
> >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> >     errno
> >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> >     Firmware
> > 
> >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> >  3 files changed, 25 insertions(+), 7 deletions(-)
> 
> Applied to pci/aardvark (both patches), thanks.

Ok! For second patch would be needed to put CC:stable line with
specifying prerequisite of first patch as written in document:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

If I understood it correctly, second patch needs following line:

Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes

where <commit_id_of_first_path> is commit id of PATCH 1/2.

(correct me if I'm wrong)

Now when first commit has commit id, could you update second commit to
include this information about prerequisite?

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 14:26     ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 14:26 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > This patch series fixes regression introduced in commit 366697018c9a
> > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > initialization failure on EspressoBin board with factory version of
> > Arm Trusted Firmware provided by Marvell.
> > 
> > Second patch depends on the first patch, so please add appropriate
> > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > stable kernels.
> > 
> > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > and with upstream ATF+uboot and aardvark was initialized successfully.
> > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > failed.
> > 
> > Pali Rohár (2):
> >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> >     errno
> >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> >     Firmware
> > 
> >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> >  3 files changed, 25 insertions(+), 7 deletions(-)
> 
> Applied to pci/aardvark (both patches), thanks.

Ok! For second patch would be needed to put CC:stable line with
specifying prerequisite of first patch as written in document:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

If I understood it correctly, second patch needs following line:

Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes

where <commit_id_of_first_path> is commit id of PATCH 1/2.

(correct me if I'm wrong)

Now when first commit has commit id, could you update second commit to
include this information about prerequisite?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 14:26     ` Pali Rohár
@ 2020-10-02 14:38       ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 14:38 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > This patch series fixes regression introduced in commit 366697018c9a
> > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > initialization failure on EspressoBin board with factory version of
> > > Arm Trusted Firmware provided by Marvell.
> > > 
> > > Second patch depends on the first patch, so please add appropriate
> > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > stable kernels.
> > > 
> > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > failed.
> > > 
> > > Pali Rohár (2):
> > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > >     errno
> > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > >     Firmware
> > > 
> > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > 
> > Applied to pci/aardvark (both patches), thanks.
> 
> Ok! For second patch would be needed to put CC:stable line with
> specifying prerequisite of first patch as written in document:
> 
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> 
> If I understood it correctly, second patch needs following line:
> 
> Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> 
> where <commit_id_of_first_path> is commit id of PATCH 1/2.
> 
> (correct me if I'm wrong)
> 
> Now when first commit has commit id, could you update second commit to
> include this information about prerequisite?

No I can't because they will be merged at the same time. What we can
do is mark the second patch for stable and during the stable review
ask to pull patch (1). Or better you shall send both patches to stable
kernels when they hit Linus' tree.

Lorenzo

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 14:38       ` Lorenzo Pieralisi
  0 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 14:38 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > This patch series fixes regression introduced in commit 366697018c9a
> > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > initialization failure on EspressoBin board with factory version of
> > > Arm Trusted Firmware provided by Marvell.
> > > 
> > > Second patch depends on the first patch, so please add appropriate
> > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > stable kernels.
> > > 
> > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > failed.
> > > 
> > > Pali Rohár (2):
> > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > >     errno
> > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > >     Firmware
> > > 
> > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > 
> > Applied to pci/aardvark (both patches), thanks.
> 
> Ok! For second patch would be needed to put CC:stable line with
> specifying prerequisite of first patch as written in document:
> 
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> 
> If I understood it correctly, second patch needs following line:
> 
> Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> 
> where <commit_id_of_first_path> is commit id of PATCH 1/2.
> 
> (correct me if I'm wrong)
> 
> Now when first commit has commit id, could you update second commit to
> include this information about prerequisite?

No I can't because they will be merged at the same time. What we can
do is mark the second patch for stable and during the stable review
ask to pull patch (1). Or better you shall send both patches to stable
kernels when they hit Linus' tree.

Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 14:38       ` Lorenzo Pieralisi
@ 2020-10-02 14:52         ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 14:52 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Friday 02 October 2020 15:38:51 Lorenzo Pieralisi wrote:
> On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> > On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > > This patch series fixes regression introduced in commit 366697018c9a
> > > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > > initialization failure on EspressoBin board with factory version of
> > > > Arm Trusted Firmware provided by Marvell.
> > > > 
> > > > Second patch depends on the first patch, so please add appropriate
> > > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > > stable kernels.
> > > > 
> > > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > > failed.
> > > > 
> > > > Pali Rohár (2):
> > > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > > >     errno
> > > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > > >     Firmware
> > > > 
> > > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > > 
> > > Applied to pci/aardvark (both patches), thanks.
> > 
> > Ok! For second patch would be needed to put CC:stable line with
> > specifying prerequisite of first patch as written in document:
> > 
> > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > 
> > If I understood it correctly, second patch needs following line:
> > 
> > Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> > 
> > where <commit_id_of_first_path> is commit id of PATCH 1/2.
> > 
> > (correct me if I'm wrong)
> > 
> > Now when first commit has commit id, could you update second commit to
> > include this information about prerequisite?
> 
> No I can't because they will be merged at the same time.

And it is a problem? Git commit id of first patch would not be changed,
so referencing to it is now possible from second commit (unless you do
rebasing).

> What we can do is mark the second patch for stable

This is done by adding "Cc: <stable@vger.kernel.org>" line to second
patch which I suggested, right?

> and during the stable review
> ask to pull patch (1). Or better you shall send both patches to stable
> kernels when they hit Linus' tree.
> 
> Lorenzo

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 14:52         ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 14:52 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Friday 02 October 2020 15:38:51 Lorenzo Pieralisi wrote:
> On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> > On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > > This patch series fixes regression introduced in commit 366697018c9a
> > > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > > initialization failure on EspressoBin board with factory version of
> > > > Arm Trusted Firmware provided by Marvell.
> > > > 
> > > > Second patch depends on the first patch, so please add appropriate
> > > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > > stable kernels.
> > > > 
> > > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > > failed.
> > > > 
> > > > Pali Rohár (2):
> > > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > > >     errno
> > > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > > >     Firmware
> > > > 
> > > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > > 
> > > Applied to pci/aardvark (both patches), thanks.
> > 
> > Ok! For second patch would be needed to put CC:stable line with
> > specifying prerequisite of first patch as written in document:
> > 
> > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > 
> > If I understood it correctly, second patch needs following line:
> > 
> > Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> > 
> > where <commit_id_of_first_path> is commit id of PATCH 1/2.
> > 
> > (correct me if I'm wrong)
> > 
> > Now when first commit has commit id, could you update second commit to
> > include this information about prerequisite?
> 
> No I can't because they will be merged at the same time.

And it is a problem? Git commit id of first patch would not be changed,
so referencing to it is now possible from second commit (unless you do
rebasing).

> What we can do is mark the second patch for stable

This is done by adding "Cc: <stable@vger.kernel.org>" line to second
patch which I suggested, right?

> and during the stable review
> ask to pull patch (1). Or better you shall send both patches to stable
> kernels when they hit Linus' tree.
> 
> Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 14:52         ` Pali Rohár
@ 2020-10-02 15:03           ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 15:03 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Fri, Oct 02, 2020 at 04:52:37PM +0200, Pali Rohár wrote:
> On Friday 02 October 2020 15:38:51 Lorenzo Pieralisi wrote:
> > On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> > > On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > > > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > > > This patch series fixes regression introduced in commit 366697018c9a
> > > > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > > > initialization failure on EspressoBin board with factory version of
> > > > > Arm Trusted Firmware provided by Marvell.
> > > > > 
> > > > > Second patch depends on the first patch, so please add appropriate
> > > > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > > > stable kernels.
> > > > > 
> > > > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > > > failed.
> > > > > 
> > > > > Pali Rohár (2):
> > > > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > > > >     errno
> > > > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > > > >     Firmware
> > > > > 
> > > > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > > > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > > > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > > > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > > > 
> > > > Applied to pci/aardvark (both patches), thanks.
> > > 
> > > Ok! For second patch would be needed to put CC:stable line with
> > > specifying prerequisite of first patch as written in document:
> > > 
> > > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > > 
> > > If I understood it correctly, second patch needs following line:
> > > 
> > > Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> > > 
> > > where <commit_id_of_first_path> is commit id of PATCH 1/2.
> > > 
> > > (correct me if I'm wrong)
> > > 
> > > Now when first commit has commit id, could you update second commit to
> > > include this information about prerequisite?
> > 
> > No I can't because they will be merged at the same time.
> 
> And it is a problem? Git commit id of first patch would not be changed,
> so referencing to it is now possible from second commit (unless you do
> rebasing).
> 
> > What we can do is mark the second patch for stable
> 
> This is done by adding "Cc: <stable@vger.kernel.org>" line to second
> patch which I suggested, right?

I will apply the stable tag and dependency, it should be fine.

Please ensure you follow up stable updates especially in case patches
don't backport properly (ie please try).

Lorenzo

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 15:03           ` Lorenzo Pieralisi
  0 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 15:03 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Fri, Oct 02, 2020 at 04:52:37PM +0200, Pali Rohár wrote:
> On Friday 02 October 2020 15:38:51 Lorenzo Pieralisi wrote:
> > On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> > > On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > > > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > > > This patch series fixes regression introduced in commit 366697018c9a
> > > > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > > > initialization failure on EspressoBin board with factory version of
> > > > > Arm Trusted Firmware provided by Marvell.
> > > > > 
> > > > > Second patch depends on the first patch, so please add appropriate
> > > > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > > > stable kernels.
> > > > > 
> > > > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > > > failed.
> > > > > 
> > > > > Pali Rohár (2):
> > > > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > > > >     errno
> > > > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > > > >     Firmware
> > > > > 
> > > > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > > > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > > > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > > > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > > > 
> > > > Applied to pci/aardvark (both patches), thanks.
> > > 
> > > Ok! For second patch would be needed to put CC:stable line with
> > > specifying prerequisite of first patch as written in document:
> > > 
> > > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > > 
> > > If I understood it correctly, second patch needs following line:
> > > 
> > > Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> > > 
> > > where <commit_id_of_first_path> is commit id of PATCH 1/2.
> > > 
> > > (correct me if I'm wrong)
> > > 
> > > Now when first commit has commit id, could you update second commit to
> > > include this information about prerequisite?
> > 
> > No I can't because they will be merged at the same time.
> 
> And it is a problem? Git commit id of first patch would not be changed,
> so referencing to it is now possible from second commit (unless you do
> rebasing).
> 
> > What we can do is mark the second patch for stable
> 
> This is done by adding "Cc: <stable@vger.kernel.org>" line to second
> patch which I suggested, right?

I will apply the stable tag and dependency, it should be fine.

Please ensure you follow up stable updates especially in case patches
don't backport properly (ie please try).

Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 15:03           ` Lorenzo Pieralisi
@ 2020-10-02 15:07             ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 15:07 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Friday 02 October 2020 16:03:09 Lorenzo Pieralisi wrote:
> On Fri, Oct 02, 2020 at 04:52:37PM +0200, Pali Rohár wrote:
> > On Friday 02 October 2020 15:38:51 Lorenzo Pieralisi wrote:
> > > On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> > > > On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > > > > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > > > > This patch series fixes regression introduced in commit 366697018c9a
> > > > > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > > > > initialization failure on EspressoBin board with factory version of
> > > > > > Arm Trusted Firmware provided by Marvell.
> > > > > > 
> > > > > > Second patch depends on the first patch, so please add appropriate
> > > > > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > > > > stable kernels.
> > > > > > 
> > > > > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > > > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > > > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > > > > failed.
> > > > > > 
> > > > > > Pali Rohár (2):
> > > > > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > > > > >     errno
> > > > > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > > > > >     Firmware
> > > > > > 
> > > > > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > > > > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > > > > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > > > > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > > > > 
> > > > > Applied to pci/aardvark (both patches), thanks.
> > > > 
> > > > Ok! For second patch would be needed to put CC:stable line with
> > > > specifying prerequisite of first patch as written in document:
> > > > 
> > > > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > > > 
> > > > If I understood it correctly, second patch needs following line:
> > > > 
> > > > Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> > > > 
> > > > where <commit_id_of_first_path> is commit id of PATCH 1/2.
> > > > 
> > > > (correct me if I'm wrong)
> > > > 
> > > > Now when first commit has commit id, could you update second commit to
> > > > include this information about prerequisite?
> > > 
> > > No I can't because they will be merged at the same time.
> > 
> > And it is a problem? Git commit id of first patch would not be changed,
> > so referencing to it is now possible from second commit (unless you do
> > rebasing).
> > 
> > > What we can do is mark the second patch for stable
> > 
> > This is done by adding "Cc: <stable@vger.kernel.org>" line to second
> > patch which I suggested, right?
> 
> I will apply the stable tag and dependency, it should be fine.

Ok! I thought that according to stable-kernel-rules.html that dependent
commit could be added after stable email address separated with # char.
At least this is how I understood stable-kernel-rules.html and its
section:

  "Additionally, some patches submitted via Option 1 may have additional
   patch prerequisites which can be cherry-picked."

> Please ensure you follow up stable updates especially in case patches
> don't backport properly (ie please try).

No problem, I can monitor emails about backporting these patches.

> Lorenzo

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 15:07             ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 15:07 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Friday 02 October 2020 16:03:09 Lorenzo Pieralisi wrote:
> On Fri, Oct 02, 2020 at 04:52:37PM +0200, Pali Rohár wrote:
> > On Friday 02 October 2020 15:38:51 Lorenzo Pieralisi wrote:
> > > On Fri, Oct 02, 2020 at 04:26:16PM +0200, Pali Rohár wrote:
> > > > On Friday 02 October 2020 14:37:13 Lorenzo Pieralisi wrote:
> > > > > On Wed, Sep 02, 2020 at 04:43:42PM +0200, Pali Rohár wrote:
> > > > > > This patch series fixes regression introduced in commit 366697018c9a
> > > > > > ("PCI: aardvark: Add PHY support") which caused aardvark driver
> > > > > > initialization failure on EspressoBin board with factory version of
> > > > > > Arm Trusted Firmware provided by Marvell.
> > > > > > 
> > > > > > Second patch depends on the first patch, so please add appropriate
> > > > > > Fixes/Cc:stable@ tags to have both patches correctly backported to
> > > > > > stable kernels.
> > > > > > 
> > > > > > I have tested both patches with Marvell ATF firmware ebin-17.10-uart.zip
> > > > > > and with upstream ATF+uboot and aardvark was initialized successfully.
> > > > > > Without this patch series on ebin-17.10-uart.zip aardvark initialization
> > > > > > failed.
> > > > > > 
> > > > > > Pali Rohár (2):
> > > > > >   phy: marvell: comphy: Convert internal SMCC firmware return codes to
> > > > > >     errno
> > > > > >   PCI: aardvark: Fix initialization with old Marvell's Arm Trusted
> > > > > >     Firmware
> > > > > > 
> > > > > >  drivers/pci/controller/pci-aardvark.c        |  4 +++-
> > > > > >  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++---
> > > > > >  drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++---
> > > > > >  3 files changed, 25 insertions(+), 7 deletions(-)
> > > > > 
> > > > > Applied to pci/aardvark (both patches), thanks.
> > > > 
> > > > Ok! For second patch would be needed to put CC:stable line with
> > > > specifying prerequisite of first patch as written in document:
> > > > 
> > > > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > > > 
> > > > If I understood it correctly, second patch needs following line:
> > > > 
> > > > Cc: <stable@vger.kernel.org> # <commit_id_of_first_path>: comphy: errno return codes
> > > > 
> > > > where <commit_id_of_first_path> is commit id of PATCH 1/2.
> > > > 
> > > > (correct me if I'm wrong)
> > > > 
> > > > Now when first commit has commit id, could you update second commit to
> > > > include this information about prerequisite?
> > > 
> > > No I can't because they will be merged at the same time.
> > 
> > And it is a problem? Git commit id of first patch would not be changed,
> > so referencing to it is now possible from second commit (unless you do
> > rebasing).
> > 
> > > What we can do is mark the second patch for stable
> > 
> > This is done by adding "Cc: <stable@vger.kernel.org>" line to second
> > patch which I suggested, right?
> 
> I will apply the stable tag and dependency, it should be fine.

Ok! I thought that according to stable-kernel-rules.html that dependent
commit could be added after stable email address separated with # char.
At least this is how I understood stable-kernel-rules.html and its
section:

  "Additionally, some patches submitted via Option 1 may have additional
   patch prerequisites which can be cherry-picked."

> Please ensure you follow up stable updates especially in case patches
> don't backport properly (ie please try).

No problem, I can monitor emails about backporting these patches.

> Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 15:07             ` Pali Rohár
@ 2020-10-02 15:15               ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 15:15 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Fri, Oct 02, 2020 at 05:07:01PM +0200, Pali Rohár wrote:

[...]

> > I will apply the stable tag and dependency, it should be fine.
> 
> Ok! I thought that according to stable-kernel-rules.html that dependent
> commit could be added after stable email address separated with # char.
> At least this is how I understood stable-kernel-rules.html and its
> section:
> 
>   "Additionally, some patches submitted via Option 1 may have additional
>    patch prerequisites which can be cherry-picked."

That's what I did - pci/aardvark branch.

Lorenzo

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 15:15               ` Lorenzo Pieralisi
  0 siblings, 0 replies; 44+ messages in thread
From: Lorenzo Pieralisi @ 2020-10-02 15:15 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Fri, Oct 02, 2020 at 05:07:01PM +0200, Pali Rohár wrote:

[...]

> > I will apply the stable tag and dependency, it should be fine.
> 
> Ok! I thought that according to stable-kernel-rules.html that dependent
> commit could be added after stable email address separated with # char.
> At least this is how I understood stable-kernel-rules.html and its
> section:
> 
>   "Additionally, some patches submitted via Option 1 may have additional
>    patch prerequisites which can be cherry-picked."

That's what I did - pci/aardvark branch.

Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
  2020-10-02 15:15               ` Lorenzo Pieralisi
@ 2020-10-02 15:20                 ` Pali Rohár
  -1 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 15:20 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Rob Herring, Bjorn Helgaas, Miquel Raynal,
	Kishon Vijay Abraham I, Vinod Koul, Marek Behún,
	Tomasz Maciej Nowak, linux-pci, linux-arm-kernel, linux-kernel

On Friday 02 October 2020 16:15:47 Lorenzo Pieralisi wrote:
> On Fri, Oct 02, 2020 at 05:07:01PM +0200, Pali Rohár wrote:
> 
> [...]
> 
> > > I will apply the stable tag and dependency, it should be fine.
> > 
> > Ok! I thought that according to stable-kernel-rules.html that dependent
> > commit could be added after stable email address separated with # char.
> > At least this is how I understood stable-kernel-rules.html and its
> > section:
> > 
> >   "Additionally, some patches submitted via Option 1 may have additional
> >    patch prerequisites which can be cherry-picked."
> 
> That's what I did - pci/aardvark branch.

Great, thank you!

I will be monitoring backport emails in case it would not be correctly
detected/cherrypicked.

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

* Re: [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF
@ 2020-10-02 15:20                 ` Pali Rohár
  0 siblings, 0 replies; 44+ messages in thread
From: Pali Rohár @ 2020-10-02 15:20 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tomasz Maciej Nowak, Rob Herring, linux-pci, linux-kernel,
	Kishon Vijay Abraham I, Vinod Koul, Miquel Raynal, Bjorn Helgaas,
	Marek Behún, linux-arm-kernel

On Friday 02 October 2020 16:15:47 Lorenzo Pieralisi wrote:
> On Fri, Oct 02, 2020 at 05:07:01PM +0200, Pali Rohár wrote:
> 
> [...]
> 
> > > I will apply the stable tag and dependency, it should be fine.
> > 
> > Ok! I thought that according to stable-kernel-rules.html that dependent
> > commit could be added after stable email address separated with # char.
> > At least this is how I understood stable-kernel-rules.html and its
> > section:
> > 
> >   "Additionally, some patches submitted via Option 1 may have additional
> >    patch prerequisites which can be cherry-picked."
> 
> That's what I did - pci/aardvark branch.

Great, thank you!

I will be monitoring backport emails in case it would not be correctly
detected/cherrypicked.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-10-02 15:21 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 14:43 [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF Pali Rohár
2020-09-02 14:43 ` Pali Rohár
2020-09-02 14:43 ` [PATCH 1/2] phy: marvell: comphy: Convert internal SMCC firmware return codes to errno Pali Rohár
2020-09-02 14:43   ` Pali Rohár
2020-09-02 16:13   ` Andrew Lunn
2020-09-02 16:13     ` Andrew Lunn
2020-09-02 16:56     ` Pali Rohár
2020-09-02 16:56       ` Pali Rohár
2020-09-02 17:00       ` Andrew Lunn
2020-09-02 17:00         ` Andrew Lunn
2020-09-02 17:05         ` Pali Rohár
2020-09-02 17:05           ` Pali Rohár
2020-09-02 17:20           ` Andrew Lunn
2020-09-02 17:20             ` Andrew Lunn
2020-09-02 17:45             ` Pali Rohár
2020-09-02 17:45               ` Pali Rohár
2020-09-30 18:17   ` Rob Herring
2020-09-30 18:17     ` Rob Herring
2020-09-02 14:43 ` [PATCH 2/2] PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware Pali Rohár
2020-09-02 14:43   ` Pali Rohár
2020-09-30 18:17   ` Rob Herring
2020-09-30 18:17     ` Rob Herring
2020-09-16 15:14 ` [PATCH 0/2] PCI: aardvark: Fix comphy with old ATF Tomasz Maciej Nowak
2020-09-16 15:14   ` Tomasz Maciej Nowak
2020-09-21 13:09   ` Pali Rohár
2020-09-21 13:09     ` Pali Rohár
2020-10-02 12:00 ` Pali Rohár
2020-10-02 12:00   ` Pali Rohár
2020-10-02 13:37 ` Lorenzo Pieralisi
2020-10-02 13:37   ` Lorenzo Pieralisi
2020-10-02 14:26   ` Pali Rohár
2020-10-02 14:26     ` Pali Rohár
2020-10-02 14:38     ` Lorenzo Pieralisi
2020-10-02 14:38       ` Lorenzo Pieralisi
2020-10-02 14:52       ` Pali Rohár
2020-10-02 14:52         ` Pali Rohár
2020-10-02 15:03         ` Lorenzo Pieralisi
2020-10-02 15:03           ` Lorenzo Pieralisi
2020-10-02 15:07           ` Pali Rohár
2020-10-02 15:07             ` Pali Rohár
2020-10-02 15:15             ` Lorenzo Pieralisi
2020-10-02 15:15               ` Lorenzo Pieralisi
2020-10-02 15:20               ` Pali Rohár
2020-10-02 15:20                 ` Pali Rohár

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.