All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org, gerg@kernel.org
Subject: [PATCH 1/4] staging: mt7621-pci: disable pcie port clock if there is no pcie link
Date: Fri, 21 Jun 2019 08:15:14 +0200	[thread overview]
Message-ID: <20190621061517.24089-2-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <20190621061517.24089-1-sergio.paracuellos@gmail.com>

When there is no pcie link detected we have to properly disable the
port pcie clock.

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

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index de09bda0b4cd..f6b91b29fb9c 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -45,6 +45,7 @@
 #define PCIE_FTS_NUM_L0(x)		((x) & 0xff << 8)
 
 /* rt_sysc_membase relative registers */
+#define RALINK_CLKCFG1			0x30
 #define RALINK_PCIE_CLK_GEN		0x7c
 #define RALINK_PCIE_CLK_GEN1		0x80
 
@@ -221,6 +222,11 @@ 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_pcie_port_clk_disable(struct mt7621_pcie_port *port)
+{
+	rt_sysc_m32(PCIE_PORT_CLK_EN(port->slot), 0, RALINK_CLKCFG1);
+}
+
 static inline void mt7621_control_assert(struct mt7621_pcie_port *port)
 {
 	u32 chip_rev_id = rt_sysc_r32(MT7621_CHIP_REV_ID);
@@ -475,6 +481,7 @@ static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
 				slot);
 			phy_power_off(port->phy);
 			mt7621_control_assert(port);
+			mt7621_pcie_port_clk_disable(port);
 			port->enabled = false;
 		}
 	}
-- 
2.19.1

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

  reply	other threads:[~2019-06-21  6:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21  6:15 [PATCH 0/4] staging: mt7621-pci: Handle minor issues Sergio Paracuellos
2019-06-21  6:15 ` Sergio Paracuellos [this message]
2019-06-21  6:15 ` [PATCH 2/4] staging: mt7621-pci: add phy exit call if phy_power_on call fails Sergio Paracuellos
2019-06-21  6:15 ` [PATCH 3/4] staging: mt7621-pci-phy: remove disable clock from the phy exit function Sergio Paracuellos
2019-06-21  6:15 ` [PATCH 4/4] staging: mt7621-pci: use 'module_init' instead of 'arch_initcall' Sergio Paracuellos
2019-06-21 12:35 ` [PATCH 0/4] staging: mt7621-pci: Handle minor issues Greg Ungerer
2019-06-21 13:23   ` Sergio Paracuellos
2019-06-23  2:15   ` Brett Neumeier
2019-06-23  5:58     ` Sergio Paracuellos
2019-06-25  5:10       ` Greg Ungerer
2019-06-25  5:18         ` Sergio Paracuellos
2019-06-25 12:47           ` Sergio Paracuellos
2019-06-26  3:31             ` Greg Ungerer
2019-06-26  7:10               ` Sergio Paracuellos
2019-06-26 12:18                 ` Greg Ungerer
2019-06-26 12:44                   ` Sergio Paracuellos
2019-07-05 18:43                     ` Brett Neumeier
2019-07-06  9:00                       ` Sergio Paracuellos
2019-07-06 13:43                         ` Brett Neumeier
2019-07-06 16:24                           ` Sergio Paracuellos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190621061517.24089-2-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gerg@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=neil@brown.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.