All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour
@ 2019-06-19  7:44 Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 1/4] staging: mt7621-pci: fix two messages in driver code Sergio Paracuellos
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-19  7:44 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel, gerg, bneumeier

Some boards seems to ignore builtin perst configuration and use gpio
instead. This approach seems to be more common. Hence, update the driver
to properly use gpio perst via gpio descriptor's API.

For more information refer to [1].

Even with this set of patches applied, there still seems to have some issues
with a non stable pci link through the boot process. This will be resolved
in nest patch series when the problem is find.

Patches are only compile-tested. It would be good to test them before being 
applied.

[1]: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2019-June/134947.html

Sergio Paracuellos (4):
  staging: mt7621-pci: fix two messages in driver code
  staging: mt7621-pci: use gpio perst instead of builtin behaviour
  staging: mt7621-dts: add gpio perst to pcie bindings node
  staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings

 drivers/staging/mt7621-dts/mt7621.dtsi        |   2 +
 .../mt7621-pci/mediatek,mt7621-pci.txt        |   2 +
 drivers/staging/mt7621-pci/pci-mt7621.c       | 108 ++++++++++--------
 3 files changed, 63 insertions(+), 49 deletions(-)

-- 
2.19.1

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

* [PATCH 1/4] staging: mt7621-pci: fix two messages in driver code
  2019-06-19  7:44 [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Sergio Paracuellos
@ 2019-06-19  7:44 ` Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 2/4] staging: mt7621-pci: use gpio perst instead of builtin behaviour Sergio Paracuellos
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-19  7:44 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel, gerg, bneumeier

There are two messages in driver code which are not correct.
Fix both of them to clarify boot runs.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 03d919a94552..7ba6ec93ac0f 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -394,7 +394,7 @@ static int mt7621_pcie_init_port(struct mt7621_pcie_port *port)
 	mt7621_reset_port(port);
 
 	val = read_config(pcie, slot, PCIE_FTS_NUM);
-	dev_info(dev, "Port %d N_FTS = %x\n", (unsigned int)val, slot);
+	dev_info(dev, "Port %d N_FTS = %x\n", slot, (unsigned int)val);
 
 	err = phy_init(port->phy);
 	if (err) {
@@ -511,7 +511,7 @@ static void mt7621_pcie_enable_ports(struct mt7621_pcie *pcie)
 					port->slot);
 				continue;
 			}
-			dev_info(dev, "PCIE%d enabled\n", slot);
+			dev_info(dev, "PCIE%d enabled\n", num_slots_enabled);
 			num_slots_enabled++;
 		}
 	}
-- 
2.19.1

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

* [PATCH 2/4] staging: mt7621-pci: use gpio perst instead of builtin behaviour
  2019-06-19  7:44 [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 1/4] staging: mt7621-pci: fix two messages in driver code Sergio Paracuellos
@ 2019-06-19  7:44 ` Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 3/4] staging: mt7621-dts: add gpio perst to pcie bindings node Sergio Paracuellos
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-19  7:44 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel, gerg

Some boards seems to ignore the PERST builtin behaviour to properly
perform a pcie line reset. Use gpio PERST behaviour instead which
seems to be more common.

Fixes: bd1a05bd87ad ("staging: mt7621-pci: use PERST_N instead of gpio control")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 106 +++++++++++++-----------
 1 file changed, 58 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 7ba6ec93ac0f..de09bda0b4cd 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -17,6 +17,7 @@
 
 #include <linux/bitops.h>
 #include <linux/delay.h>
+#include <linux/gpio/consumer.h>
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -35,6 +36,7 @@
 
 /* sysctl */
 #define MT7621_CHIP_REV_ID		0x0c
+#define MT7621_GPIO_MODE		0x60
 #define CHIP_REV_MT7621_E2		0x0101
 
 /* MediaTek specific configuration registers */
@@ -81,7 +83,6 @@
 #define PCIE_BAR_ENABLE			BIT(0)
 #define PCIE_PORT_INT_EN(x)		BIT(20 + (x))
 #define PCIE_PORT_CLK_EN(x)		BIT(24 + (x))
-#define PCIE_PORT_PERST(x)		BIT(1 + (x))
 #define PCIE_PORT_LINKUP		BIT(0)
 
 #define PCIE_CLK_GEN_EN			BIT(31)
@@ -89,6 +90,9 @@
 #define PCIE_CLK_GEN1_DIS		GENMASK(30, 24)
 #define PCIE_CLK_GEN1_EN		(BIT(27) | BIT(25))
 #define MEMORY_BASE			0x0
+#define PERST_MODE_MASK			GENMASK(11, 10)
+#define PERST_MODE_GPIO			BIT(10)
+#define PERST_DELAY_US			1000
 
 /**
  * struct mt7621_pcie_port - PCIe port information
@@ -119,6 +123,7 @@ struct mt7621_pcie_port {
  * @offset: IO / Memory offset
  * @dev: Pointer to PCIe device
  * @ports: pointer to PCIe port information
+ * @perst: gpio reset
  * @rst: pointer to pcie reset
  */
 struct mt7621_pcie {
@@ -132,6 +137,7 @@ struct mt7621_pcie {
 		resource_size_t io;
 	} offset;
 	struct list_head ports;
+	struct gpio_desc *perst;
 	struct reset_control *rst;
 };
 
@@ -198,6 +204,23 @@ static void write_config(struct mt7621_pcie *pcie, unsigned int dev,
 	pcie_write(pcie, val, RALINK_PCI_CONFIG_DATA);
 }
 
+static inline void mt7621_perst_gpio_pcie_assert(struct mt7621_pcie *pcie)
+{
+	gpiod_set_value(pcie->perst, 0);
+	mdelay(PERST_DELAY_US);
+}
+
+static inline void mt7621_perst_gpio_pcie_deassert(struct mt7621_pcie *pcie)
+{
+	gpiod_set_value(pcie->perst, 1);
+	mdelay(PERST_DELAY_US);
+}
+
+static inline bool mt7621_pcie_port_is_linkup(struct mt7621_pcie_port *port)
+{
+	return (pcie_port_read(port, RALINK_PCI_STATUS) & PCIE_PORT_LINKUP) != 0;
+}
+
 static inline void mt7621_control_assert(struct mt7621_pcie_port *port)
 {
 	u32 chip_rev_id = rt_sysc_r32(MT7621_CHIP_REV_ID);
@@ -344,6 +367,12 @@ static int mt7621_pcie_parse_dt(struct mt7621_pcie *pcie)
 	struct resource regs;
 	int err;
 
+	pcie->perst = devm_gpiod_get(dev, "perst", GPIOD_OUT_HIGH);
+	if (IS_ERR(pcie->perst)) {
+		dev_err(dev, "failed to get gpio perst\n");
+		return PTR_ERR(pcie->perst);
+	}
+
 	err = of_address_to_resource(node, 0, &regs);
 	if (err) {
 		dev_err(dev, "missing \"reg\" property\n");
@@ -384,7 +413,6 @@ static int mt7621_pcie_init_port(struct mt7621_pcie_port *port)
 	struct mt7621_pcie *pcie = port->pcie;
 	struct device *dev = pcie->dev;
 	u32 slot = port->slot;
-	u32 val = 0;
 	int err;
 
 	/*
@@ -393,47 +421,34 @@ static int mt7621_pcie_init_port(struct mt7621_pcie_port *port)
 	 */
 	mt7621_reset_port(port);
 
-	val = read_config(pcie, slot, PCIE_FTS_NUM);
-	dev_info(dev, "Port %d N_FTS = %x\n", slot, (unsigned int)val);
-
 	err = phy_init(port->phy);
 	if (err) {
 		dev_err(dev, "failed to initialize port%d phy\n", slot);
-		goto err_phy_init;
+		return err;
 	}
 
 	err = phy_power_on(port->phy);
 	if (err) {
 		dev_err(dev, "failed to power on port%d phy\n", slot);
-		goto err_phy_on;
-	}
-
-	if ((pcie_port_read(port, RALINK_PCI_STATUS) & PCIE_PORT_LINKUP) == 0) {
-		dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n", slot);
-		mt7621_control_assert(port);
-		port->enabled = false;
-		err = -ENODEV;
-		goto err_no_link_up;
+		return err;
 	}
 
 	port->enabled = true;
 
 	return 0;
-
-err_no_link_up:
-	phy_power_off(port->phy);
-err_phy_on:
-	phy_exit(port->phy);
-err_phy_init:
-	return err;
 }
 
 static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
 {
 	struct device *dev = pcie->dev;
 	struct mt7621_pcie_port *port, *tmp;
+	u32 val = 0;
 	int err;
 
+	rt_sysc_m32(PERST_MODE_MASK, PERST_MODE_GPIO, MT7621_GPIO_MODE);
+
+	mt7621_perst_gpio_pcie_assert(pcie);
+
 	list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
 		u32 slot = port->slot;
 
@@ -441,10 +456,29 @@ static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
 		if (err) {
 			dev_err(dev, "Initiating port %d failed\n", slot);
 			list_del(&port->list);
+		} else {
+			val = read_config(pcie, slot, PCIE_FTS_NUM);
+			dev_info(dev, "Port %d N_FTS = %x\n", slot,
+				 (unsigned int)val);
 		}
 	}
 
 	reset_control_assert(pcie->rst);
+
+	mt7621_perst_gpio_pcie_deassert(pcie);
+
+	list_for_each_entry(port, &pcie->ports, list) {
+		u32 slot = port->slot;
+
+		if (!mt7621_pcie_port_is_linkup(port)) {
+			dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n",
+				slot);
+			phy_power_off(port->phy);
+			mt7621_control_assert(port);
+			port->enabled = false;
+		}
+	}
+
 	rt_sysc_m32(0x30, 2 << 4, SYSC_REG_SYSTEM_CONFIG1);
 	rt_sysc_m32(PCIE_CLK_GEN_EN, PCIE_CLK_GEN_DIS, RALINK_PCIE_CLK_GEN);
 	rt_sysc_m32(PCIE_CLK_GEN1_DIS, PCIE_CLK_GEN1_EN, RALINK_PCIE_CLK_GEN1);
@@ -453,30 +487,12 @@ static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
 	reset_control_deassert(pcie->rst);
 }
 
-static int mt7621_pcie_enable_port(struct mt7621_pcie_port *port)
+static void mt7621_pcie_enable_port(struct mt7621_pcie_port *port)
 {
 	struct mt7621_pcie *pcie = port->pcie;
 	u32 slot = port->slot;
 	u32 offset = MT7621_PCIE_OFFSET + (slot * MT7621_NEXT_PORT);
 	u32 val;
-	int err;
-
-	/* assert port PERST_N */
-	val = pcie_read(pcie, RALINK_PCI_PCICFG_ADDR);
-	val |= PCIE_PORT_PERST(slot);
-	pcie_write(pcie, val, RALINK_PCI_PCICFG_ADDR);
-
-	/* de-assert port PERST_N */
-	val = pcie_read(pcie, RALINK_PCI_PCICFG_ADDR);
-	val &= ~PCIE_PORT_PERST(slot);
-	pcie_write(pcie, val, RALINK_PCI_PCICFG_ADDR);
-
-	/* 100ms timeout value should be enough for Gen1 training */
-	err = readl_poll_timeout(port->base + RALINK_PCI_STATUS,
-				 val, !!(val & PCIE_PORT_LINKUP),
-				 20, 100 * USEC_PER_MSEC);
-	if (err)
-		return -ETIMEDOUT;
 
 	/* enable pcie interrupt */
 	val = pcie_read(pcie, RALINK_PCI_PCIMSK_ADDR);
@@ -492,8 +508,6 @@ static int mt7621_pcie_enable_port(struct mt7621_pcie_port *port)
 	/* configure class code and revision ID */
 	pcie_write(pcie, PCIE_CLASS_CODE | PCIE_REVISION_ID,
 		   offset + RALINK_PCI_CLASS);
-
-	return 0;
 }
 
 static void mt7621_pcie_enable_ports(struct mt7621_pcie *pcie)
@@ -506,11 +520,7 @@ static void mt7621_pcie_enable_ports(struct mt7621_pcie *pcie)
 
 	list_for_each_entry(port, &pcie->ports, list) {
 		if (port->enabled) {
-			if (mt7621_pcie_enable_port(port)) {
-				dev_err(dev, "de-assert port %d PERST_N\n",
-					port->slot);
-				continue;
-			}
+			mt7621_pcie_enable_port(port);
 			dev_info(dev, "PCIE%d enabled\n", num_slots_enabled);
 			num_slots_enabled++;
 		}
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 3/4] staging: mt7621-dts: add gpio perst to pcie bindings node
  2019-06-19  7:44 [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 1/4] staging: mt7621-pci: fix two messages in driver code Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 2/4] staging: mt7621-pci: use gpio perst instead of builtin behaviour Sergio Paracuellos
@ 2019-06-19  7:44 ` Sergio Paracuellos
  2019-06-19  7:44 ` [PATCH 4/4] staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings Sergio Paracuellos
  2019-06-20  0:40 ` [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Greg Ungerer
  4 siblings, 0 replies; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-19  7:44 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel, gerg

Driver has been changed to use perts gpio reset instead of
perst builtin behaviour. Update device tree accordly.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-dts/mt7621.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi
index 280ec33c8540..9c90cac82efc 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -1,4 +1,5 @@
 #include <dt-bindings/interrupt-controller/mips-gic.h>
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	#address-cells = <1>;
@@ -468,6 +469,7 @@
 		#address-cells = <3>;
 		#size-cells = <2>;
 
+		perst-gpio = <&gpio 19 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pcie_pins>;
 
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 4/4] staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings
  2019-06-19  7:44 [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Sergio Paracuellos
                   ` (2 preceding siblings ...)
  2019-06-19  7:44 ` [PATCH 3/4] staging: mt7621-dts: add gpio perst to pcie bindings node Sergio Paracuellos
@ 2019-06-19  7:44 ` Sergio Paracuellos
  2019-06-20  0:40 ` [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Greg Ungerer
  4 siblings, 0 replies; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-19  7:44 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel, gerg

Both driver and device tree have been updated to use GPIO perst.
Update bindings documentation also.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt b/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt
index 5a6ee4103cd5..604ec813bd45 100644
--- a/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt
+++ b/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt
@@ -6,6 +6,7 @@ Required properties:
 - reg: Base addresses and lengths of the PCIe subsys and root ports.
 - bus-range: Range of bus numbers associated with this controller.
 - #address-cells: Address representation for root ports (must be 3)
+- perst-gpio: PCIe reset signal line.
 - pinctrl-names : The pin control state names.
 - pinctrl-0: The "default" pinctrl state.
 - #size-cells: Size representation for root ports (must be 2)
@@ -48,6 +49,7 @@ Example for MT7621:
 		#address-cells = <3>;
 		#size-cells = <2>;
 
+		perst-gpio = <&gpio 19 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pcie_pins>;
 
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour
  2019-06-19  7:44 [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Sergio Paracuellos
                   ` (3 preceding siblings ...)
  2019-06-19  7:44 ` [PATCH 4/4] staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings Sergio Paracuellos
@ 2019-06-20  0:40 ` Greg Ungerer
  2019-06-20  5:20   ` Sergio Paracuellos
  4 siblings, 1 reply; 9+ messages in thread
From: Greg Ungerer @ 2019-06-20  0:40 UTC (permalink / raw)
  To: Sergio Paracuellos, gregkh; +Cc: neil, driverdev-devel

Hi Sergio,

On 19/6/19 5:44 pm, Sergio Paracuellos wrote:
> Some boards seems to ignore builtin perst configuration and use gpio
> instead. This approach seems to be more common. Hence, update the driver
> to properly use gpio perst via gpio descriptor's API.
> 
> For more information refer to [1].
> 
> Even with this set of patches applied, there still seems to have some issues
> with a non stable pci link through the boot process. This will be resolved
> in nest patch series when the problem is find.
> 
> Patches are only compile-tested. It would be good to test them before being
> applied.
> 
> [1]: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2019-June/134947.html
> 
> Sergio Paracuellos (4):
>    staging: mt7621-pci: fix two messages in driver code
>    staging: mt7621-pci: use gpio perst instead of builtin behaviour
>    staging: mt7621-dts: add gpio perst to pcie bindings node
>    staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings
> 
>   drivers/staging/mt7621-dts/mt7621.dtsi        |   2 +
>   .../mt7621-pci/mediatek,mt7621-pci.txt        |   2 +
>   drivers/staging/mt7621-pci/pci-mt7621.c       | 108 ++++++++++--------
>   3 files changed, 63 insertions(+), 49 deletions(-)

Thanks for putting this together.

I tried a quick test, applying this onto a linux-5.2.0-rc5 kernel and
saw this in the boot trace:

   ...
   rt2880-pinmux pinctrl: pcie is already enabled
   mt7621-pci 1e140000.pcie: Error applying setting, reverse things back
   ...

The system went on to boot successfully, with PCI working.

Testing across multiple boots, it sometimes hangs - but we know about that
and it is what we are still looking into.

Regards
Greg


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour
  2019-06-20  0:40 ` [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Greg Ungerer
@ 2019-06-20  5:20   ` Sergio Paracuellos
  2019-06-20 12:31     ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-20  5:20 UTC (permalink / raw)
  To: Greg Ungerer; +Cc: NeilBrown, Greg KH, driverdev-devel

Hi Greg,

On Thu, Jun 20, 2019 at 2:40 AM Greg Ungerer <gerg@kernel.org> wrote:
>
> Hi Sergio,
>
> On 19/6/19 5:44 pm, Sergio Paracuellos wrote:
> > Some boards seems to ignore builtin perst configuration and use gpio
> > instead. This approach seems to be more common. Hence, update the driver
> > to properly use gpio perst via gpio descriptor's API.
> >
> > For more information refer to [1].
> >
> > Even with this set of patches applied, there still seems to have some issues
> > with a non stable pci link through the boot process. This will be resolved
> > in nest patch series when the problem is find.
> >
> > Patches are only compile-tested. It would be good to test them before being
> > applied.
> >
> > [1]: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2019-June/134947.html
> >
> > Sergio Paracuellos (4):
> >    staging: mt7621-pci: fix two messages in driver code
> >    staging: mt7621-pci: use gpio perst instead of builtin behaviour
> >    staging: mt7621-dts: add gpio perst to pcie bindings node
> >    staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings
> >
> >   drivers/staging/mt7621-dts/mt7621.dtsi        |   2 +
> >   .../mt7621-pci/mediatek,mt7621-pci.txt        |   2 +
> >   drivers/staging/mt7621-pci/pci-mt7621.c       | 108 ++++++++++--------
> >   3 files changed, 63 insertions(+), 49 deletions(-)
>
> Thanks for putting this together.
>
> I tried a quick test, applying this onto a linux-5.2.0-rc5 kernel and
> saw this in the boot trace:
>
>    ...
>    rt2880-pinmux pinctrl: pcie is already enabled
>    mt7621-pci 1e140000.pcie: Error applying setting, reverse things back
>    ...
>
> The system went on to boot successfully, with PCI working.
>
> Testing across multiple boots, it sometimes hangs - but we know about that
> and it is what we are still looking into.

Ok, thanks for testing this. Let's apply this patch series first.

GregKH, can we also apply this for linux-stable? kernel 5.1. Should I
sent anything else for that?

>
> Regards
> Greg

Best regards,
    Sergio Paracuellos
>
>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour
  2019-06-20  5:20   ` Sergio Paracuellos
@ 2019-06-20 12:31     ` Greg KH
  2019-06-20 12:43       ` Sergio Paracuellos
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2019-06-20 12:31 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: Greg Ungerer, NeilBrown, driverdev-devel

On Thu, Jun 20, 2019 at 07:20:52AM +0200, Sergio Paracuellos wrote:
> Hi Greg,
> 
> On Thu, Jun 20, 2019 at 2:40 AM Greg Ungerer <gerg@kernel.org> wrote:
> >
> > Hi Sergio,
> >
> > On 19/6/19 5:44 pm, Sergio Paracuellos wrote:
> > > Some boards seems to ignore builtin perst configuration and use gpio
> > > instead. This approach seems to be more common. Hence, update the driver
> > > to properly use gpio perst via gpio descriptor's API.
> > >
> > > For more information refer to [1].
> > >
> > > Even with this set of patches applied, there still seems to have some issues
> > > with a non stable pci link through the boot process. This will be resolved
> > > in nest patch series when the problem is find.
> > >
> > > Patches are only compile-tested. It would be good to test them before being
> > > applied.
> > >
> > > [1]: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2019-June/134947.html
> > >
> > > Sergio Paracuellos (4):
> > >    staging: mt7621-pci: fix two messages in driver code
> > >    staging: mt7621-pci: use gpio perst instead of builtin behaviour
> > >    staging: mt7621-dts: add gpio perst to pcie bindings node
> > >    staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings
> > >
> > >   drivers/staging/mt7621-dts/mt7621.dtsi        |   2 +
> > >   .../mt7621-pci/mediatek,mt7621-pci.txt        |   2 +
> > >   drivers/staging/mt7621-pci/pci-mt7621.c       | 108 ++++++++++--------
> > >   3 files changed, 63 insertions(+), 49 deletions(-)
> >
> > Thanks for putting this together.
> >
> > I tried a quick test, applying this onto a linux-5.2.0-rc5 kernel and
> > saw this in the boot trace:
> >
> >    ...
> >    rt2880-pinmux pinctrl: pcie is already enabled
> >    mt7621-pci 1e140000.pcie: Error applying setting, reverse things back
> >    ...
> >
> > The system went on to boot successfully, with PCI working.
> >
> > Testing across multiple boots, it sometimes hangs - but we know about that
> > and it is what we are still looking into.
> 
> Ok, thanks for testing this. Let's apply this patch series first.
> 
> GregKH, can we also apply this for linux-stable? kernel 5.1. Should I
> sent anything else for that?

Which specific patch(s) are needed for 5.1?  What about 5.2-final?

How about we just merge these into 5.3-rc1 and then you send
stable@vger.kernel.org the git commit ids that you want backported to
5.2?

thanks,

greg k-h

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

* Re: [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour
  2019-06-20 12:31     ` Greg KH
@ 2019-06-20 12:43       ` Sergio Paracuellos
  0 siblings, 0 replies; 9+ messages in thread
From: Sergio Paracuellos @ 2019-06-20 12:43 UTC (permalink / raw)
  To: Greg KH; +Cc: NeilBrown, driverdev-devel, Greg Ungerer

Hi Greg,

On Thu, Jun 20, 2019 at 2:31 PM Greg KH <gregkh@linuxfoundation.org> wrote:

[snip]

> > Ok, thanks for testing this. Let's apply this patch series first.
> >
> > GregKH, can we also apply this for linux-stable? kernel 5.1. Should I
> > sent anything else for that?
>
> Which specific patch(s) are needed for 5.1?  What about 5.2-final?
>
> How about we just merge these into 5.3-rc1 and then you send
> stable@vger.kernel.org the git commit ids that you want backported to
> 5.2?

For me is ok to send the ids to be added for 5.2, so please, add this
in the way is more confortable for you.

>
> thanks,
>
> greg k-h

Best regards,
    Sergio Paracuellos
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2019-06-20 12:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19  7:44 [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Sergio Paracuellos
2019-06-19  7:44 ` [PATCH 1/4] staging: mt7621-pci: fix two messages in driver code Sergio Paracuellos
2019-06-19  7:44 ` [PATCH 2/4] staging: mt7621-pci: use gpio perst instead of builtin behaviour Sergio Paracuellos
2019-06-19  7:44 ` [PATCH 3/4] staging: mt7621-dts: add gpio perst to pcie bindings node Sergio Paracuellos
2019-06-19  7:44 ` [PATCH 4/4] staging: mt7621-pci: dt-bindings: add perst-gpio to sample bindings Sergio Paracuellos
2019-06-20  0:40 ` [PATCH 0/4] staging: mt7621-pci: Use gpio perst instead builtin behaviour Greg Ungerer
2019-06-20  5:20   ` Sergio Paracuellos
2019-06-20 12:31     ` Greg KH
2019-06-20 12:43       ` Sergio Paracuellos

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.