Skip to content

Commit

Permalink
Merge tag 'reset-fixes-for-v5.15' of git://git.pengutronix.de/pza/lin…
Browse files Browse the repository at this point in the history
…ux into arm/fixes

Reset controller fixes for v5.15

Fix the status bit polarity in the brcmstb-rescal driver, re-enable
pistachio driver selection after MACH_PISTACHIO removal, add transfer
error handling in the tegra-bpmp driver, and fix probing of the
reset-socfpga driver after recent device link changes.

* tag 'reset-fixes-for-v5.15' of git://git.pengutronix.de/pza/linux:
  reset: socfpga: add empty driver allowing consumers to probe
  reset: tegra-bpmp: Handle errors in BPMP response
  reset: pistachio: Re-enable driver selection
  reset: brcmstb-rescal: fix incorrect polarity of status bit

Link: https://lore.kernel.org/r/b378f2aae54538db6a13c98561b4cbcacbef937c.camel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Oct 20, 2021
2 parents e23c748 + 3ad60b4 commit 36b6dcb
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/reset/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ config RESET_OXNAS
bool

config RESET_PISTACHIO
bool "Pistachio Reset Driver" if COMPILE_TEST
default MACH_PISTACHIO
bool "Pistachio Reset Driver"
depends on MIPS || COMPILE_TEST
help
This enables the reset driver for ImgTec Pistachio SoCs.

Expand Down
2 changes: 1 addition & 1 deletion drivers/reset/reset-brcmstb-rescal.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev,
}

ret = readl_poll_timeout(base + BRCM_RESCAL_STATUS, reg,
!(reg & BRCM_RESCAL_STATUS_BIT), 100, 1000);
(reg & BRCM_RESCAL_STATUS_BIT), 100, 1000);
if (ret) {
dev_err(data->dev, "time out on SATA/PCIe rescal\n");
return ret;
Expand Down
26 changes: 26 additions & 0 deletions drivers/reset/reset-socfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,29 @@ void __init socfpga_reset_init(void)
for_each_matching_node(np, socfpga_early_reset_dt_ids)
a10_reset_init(np);
}

/*
* The early driver is problematic, because it doesn't register
* itself as a driver. This causes certain device links to prevent
* consumer devices from probing. The hacky solution is to register
* an empty driver, whose only job is to attach itself to the reset
* manager and call probe.
*/
static const struct of_device_id socfpga_reset_dt_ids[] = {
{ .compatible = "altr,rst-mgr", },
{ /* sentinel */ },
};

static int reset_simple_probe(struct platform_device *pdev)
{
return 0;
}

static struct platform_driver reset_socfpga_driver = {
.probe = reset_simple_probe,
.driver = {
.name = "socfpga-reset",
.of_match_table = socfpga_reset_dt_ids,
},
};
builtin_platform_driver(reset_socfpga_driver);
9 changes: 8 additions & 1 deletion drivers/reset/tegra/reset-bpmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
struct tegra_bpmp *bpmp = to_tegra_bpmp(rstc);
struct mrq_reset_request request;
struct tegra_bpmp_message msg;
int err;

memset(&request, 0, sizeof(request));
request.cmd = command;
Expand All @@ -30,7 +31,13 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
msg.tx.data = &request;
msg.tx.size = sizeof(request);

return tegra_bpmp_transfer(bpmp, &msg);
err = tegra_bpmp_transfer(bpmp, &msg);
if (err)
return err;
if (msg.rx.ret)
return -EINVAL;

return 0;
}

static int tegra_bpmp_reset_module(struct reset_controller_dev *rstc,
Expand Down

0 comments on commit 36b6dcb

Please sign in to comment.