Skip to content

Commit 0dbc357

Browse files
committed
Merge tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain fixes from Ulf Hansson: - imx: - Fix system wakeup support for imx8mp power domains - Fix potential out-of-range access for imx8m power domains - Fix the imx8mm gpu hang - qcom: Fix off-by-one error for highest state in rpmpd * tag 'pmdomain-v6.19-rc3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: imx8mp-blk-ctrl: Keep usb phy power domain on for system wakeup pmdomain: imx8mp-blk-ctrl: Keep gpc power domain on for system wakeup pmdomain: imx8m-blk-ctrl: fix out-of-range access of bc->domains pmdomain: imx: gpcv2: Fix the imx8mm gpu hang due to wrong adb400 reset pmdomain: qcom: rpmpd: fix off-by-one error in clamping to the highest state
2 parents 8aa3041 + e2c4c5b commit 0dbc357

4 files changed

Lines changed: 34 additions & 8 deletions

File tree

drivers/pmdomain/imx/gpcv2.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,11 @@
165165
#define IMX8M_VPU_HSK_PWRDNREQN BIT(5)
166166
#define IMX8M_DISP_HSK_PWRDNREQN BIT(4)
167167

168-
#define IMX8MM_GPUMIX_HSK_PWRDNACKN BIT(29)
169-
#define IMX8MM_GPU_HSK_PWRDNACKN (BIT(27) | BIT(28))
168+
#define IMX8MM_GPU_HSK_PWRDNACKN GENMASK(29, 27)
170169
#define IMX8MM_VPUMIX_HSK_PWRDNACKN BIT(26)
171170
#define IMX8MM_DISPMIX_HSK_PWRDNACKN BIT(25)
172171
#define IMX8MM_HSIO_HSK_PWRDNACKN (BIT(23) | BIT(24))
173-
#define IMX8MM_GPUMIX_HSK_PWRDNREQN BIT(11)
174-
#define IMX8MM_GPU_HSK_PWRDNREQN (BIT(9) | BIT(10))
172+
#define IMX8MM_GPU_HSK_PWRDNREQN GENMASK(11, 9)
175173
#define IMX8MM_VPUMIX_HSK_PWRDNREQN BIT(8)
176174
#define IMX8MM_DISPMIX_HSK_PWRDNREQN BIT(7)
177175
#define IMX8MM_HSIO_HSK_PWRDNREQN (BIT(5) | BIT(6))
@@ -794,8 +792,6 @@ static const struct imx_pgc_domain imx8mm_pgc_domains[] = {
794792
.bits = {
795793
.pxx = IMX8MM_GPUMIX_SW_Pxx_REQ,
796794
.map = IMX8MM_GPUMIX_A53_DOMAIN,
797-
.hskreq = IMX8MM_GPUMIX_HSK_PWRDNREQN,
798-
.hskack = IMX8MM_GPUMIX_HSK_PWRDNACKN,
799795
},
800796
.pgc = BIT(IMX8MM_PGC_GPUMIX),
801797
.keep_clocks = true,

drivers/pmdomain/imx/imx8m-blk-ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static void imx8m_blk_ctrl_remove(struct platform_device *pdev)
340340

341341
of_genpd_del_provider(pdev->dev.of_node);
342342

343-
for (i = 0; bc->onecell_data.num_domains; i++) {
343+
for (i = 0; i < bc->onecell_data.num_domains; i++) {
344344
struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
345345

346346
pm_genpd_remove(&domain->genpd);

drivers/pmdomain/imx/imx8mp-blk-ctrl.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct imx8mp_blk_ctrl_domain_data {
5353
const char * const *path_names;
5454
int num_paths;
5555
const char *gpc_name;
56+
const unsigned int flags;
5657
};
5758

5859
#define DOMAIN_MAX_CLKS 3
@@ -65,6 +66,7 @@ struct imx8mp_blk_ctrl_domain {
6566
struct icc_bulk_data paths[DOMAIN_MAX_PATHS];
6667
struct device *power_dev;
6768
struct imx8mp_blk_ctrl *bc;
69+
struct notifier_block power_nb;
6870
int num_paths;
6971
int id;
7072
};
@@ -264,10 +266,12 @@ static const struct imx8mp_blk_ctrl_domain_data imx8mp_hsio_domain_data[] = {
264266
[IMX8MP_HSIOBLK_PD_USB_PHY1] = {
265267
.name = "hsioblk-usb-phy1",
266268
.gpc_name = "usb-phy1",
269+
.flags = GENPD_FLAG_ACTIVE_WAKEUP,
267270
},
268271
[IMX8MP_HSIOBLK_PD_USB_PHY2] = {
269272
.name = "hsioblk-usb-phy2",
270273
.gpc_name = "usb-phy2",
274+
.flags = GENPD_FLAG_ACTIVE_WAKEUP,
271275
},
272276
[IMX8MP_HSIOBLK_PD_PCIE] = {
273277
.name = "hsioblk-pcie",
@@ -594,6 +598,20 @@ static int imx8mp_blk_ctrl_power_off(struct generic_pm_domain *genpd)
594598
return 0;
595599
}
596600

601+
static int imx8mp_blk_ctrl_gpc_notifier(struct notifier_block *nb,
602+
unsigned long action, void *data)
603+
{
604+
struct imx8mp_blk_ctrl_domain *domain =
605+
container_of(nb, struct imx8mp_blk_ctrl_domain, power_nb);
606+
607+
if (action == GENPD_NOTIFY_PRE_OFF) {
608+
if (domain->genpd.status == GENPD_STATE_ON)
609+
return NOTIFY_BAD;
610+
}
611+
612+
return NOTIFY_OK;
613+
}
614+
597615
static struct lock_class_key blk_ctrl_genpd_lock_class;
598616

599617
static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
@@ -698,15 +716,25 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
698716
goto cleanup_pds;
699717
}
700718

719+
domain->power_nb.notifier_call = imx8mp_blk_ctrl_gpc_notifier;
720+
ret = dev_pm_genpd_add_notifier(domain->power_dev, &domain->power_nb);
721+
if (ret) {
722+
dev_err_probe(dev, ret, "failed to add power notifier\n");
723+
dev_pm_domain_detach(domain->power_dev, true);
724+
goto cleanup_pds;
725+
}
726+
701727
domain->genpd.name = data->name;
702728
domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
703729
domain->genpd.power_off = imx8mp_blk_ctrl_power_off;
730+
domain->genpd.flags = data->flags;
704731
domain->bc = bc;
705732
domain->id = i;
706733

707734
ret = pm_genpd_init(&domain->genpd, NULL, true);
708735
if (ret) {
709736
dev_err_probe(dev, ret, "failed to init power domain\n");
737+
dev_pm_genpd_remove_notifier(domain->power_dev);
710738
dev_pm_domain_detach(domain->power_dev, true);
711739
goto cleanup_pds;
712740
}
@@ -755,6 +783,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
755783
cleanup_pds:
756784
for (i--; i >= 0; i--) {
757785
pm_genpd_remove(&bc->domains[i].genpd);
786+
dev_pm_genpd_remove_notifier(bc->domains[i].power_dev);
758787
dev_pm_domain_detach(bc->domains[i].power_dev, true);
759788
}
760789

@@ -774,6 +803,7 @@ static void imx8mp_blk_ctrl_remove(struct platform_device *pdev)
774803
struct imx8mp_blk_ctrl_domain *domain = &bc->domains[i];
775804

776805
pm_genpd_remove(&domain->genpd);
806+
dev_pm_genpd_remove_notifier(domain->power_dev);
777807
dev_pm_domain_detach(domain->power_dev, true);
778808
}
779809

drivers/pmdomain/qcom/rpmpd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static int rpmpd_aggregate_corner(struct rpmpd *pd)
10011001

10021002
/* Clamp to the highest corner/level if sync_state isn't done yet */
10031003
if (!pd->state_synced)
1004-
this_active_corner = this_sleep_corner = pd->max_state - 1;
1004+
this_active_corner = this_sleep_corner = pd->max_state;
10051005
else
10061006
to_active_sleep(pd, pd->corner, &this_active_corner, &this_sleep_corner);
10071007

0 commit comments

Comments
 (0)