lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <604ed10b-87a1-4b9f-8cf1-96406b34fcad@US01WEHTC1.internal.synopsys.com>
Date:   Wed, 10 May 2017 16:26:59 +0400
From:   Razmik Karapetyan <Razmik.Karapetyan@...opsys.com>
To:     John Youn <John.Youn@...opsys.com>,
        Felipe Balbi <balbi@...nel.org>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     Razmik Karapetyan <Razmik.Karapetyan@...opsys.com>
Subject: [PATCH v3 4/4] usb: dwc2: Backup and restore PCGCCTL1 register

Backup PCGCCTL1 register when entering hibernation mode and
restore it after exiting from hibernation, to keep active ACG
feature.

Signed-off-by: Razmik Karapetyan <razmik@...opsys.com>
---
 drivers/usb/dwc2/core.c | 2 ++
 drivers/usb/dwc2/core.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index 21fa39eada5b..06e500e59390 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -79,6 +79,7 @@ static int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg)
 	gr->gnptxfsiz = dwc2_readl(hsotg->regs + GNPTXFSIZ);
 	gr->hptxfsiz = dwc2_readl(hsotg->regs + HPTXFSIZ);
 	gr->gdfifocfg = dwc2_readl(hsotg->regs + GDFIFOCFG);
+	gr->pcgcctl1 = dwc2_readl(hsotg->regs + PCGCCTL1);
 	for (i = 0; i < MAX_EPS_CHANNELS; i++)
 		gr->dtxfsiz[i] = dwc2_readl(hsotg->regs + DPTXFSIZN(i));
 
@@ -118,6 +119,7 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg)
 	dwc2_writel(gr->gnptxfsiz, hsotg->regs + GNPTXFSIZ);
 	dwc2_writel(gr->hptxfsiz, hsotg->regs + HPTXFSIZ);
 	dwc2_writel(gr->gdfifocfg, hsotg->regs + GDFIFOCFG);
+	dwc2_writel(gr->pcgcctl1, hsotg->regs + PCGCCTL1);
 	for (i = 0; i < MAX_EPS_CHANNELS; i++)
 		dwc2_writel(gr->dtxfsiz[i], hsotg->regs + DPTXFSIZN(i));
 
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index a20d1665c68f..b16cd3e64149 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -617,6 +617,7 @@ struct dwc2_gregs_backup {
 	u32 gi2cctl;
 	u32 hptxfsiz;
 	u32 pcgcctl;
+	u32 pcgcctl1;
 	u32 gdfifocfg;
 	u32 dtxfsiz[MAX_EPS_CHANNELS];
 	u32 gpwrdn;
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ