A small set of clockevent fixes which fell through the cracks
before the 5.11 release: - Ensure a clock is enabled on sh_cmt - Trivial compile fail and compile warning fixes -----BEGIN PGP SIGNATURE----- iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmA0A4QTHHRnbHhAbGlu dXRyb25peC5kZQAKCRCmGPVMDXSYoUopD/9txKYMgYoUZP0H49JcvuWucilYz3eo vQitUwfSx6zavtM4vbAiYhGkjc826/6ljqfgbxUVlhLhQr+4p3RrTUwkrCKYUh0Q ohG3/KemqyPN2q1JG6Uf4gcnQn3SLe7ljvYmSxrr9XPtd+hq0+smDKS2ROgFTPS1 +5axxVrqnVxQF0UIyU9zrcnT/IDR1kPPHJ68lauF4U0z0mDBIyW81giAI8iFTx8W e15mtn4tGOf4nArRPi/4xsrpPUaphzfu9vmcs9XevQJugnXkvKwgdWlefszPdjPb JqP+L56AE3/R39fxe25KuHJVdNgXEvyxT+BmCuKveDRxIIOdAdg9XxS2TRg1RDOV pQU+pUHr3JB5IzMYJrf6LTpzyEazCaxewEys8kIejPoAGRcyQcja2UYOnXvmySQb DU2b9rSotsAe6oqwyi34nAdexpv7+PWIx69xIzNWEdTS8yy0dn4j1f9c7hRGNp/S XC4MNdgqsK7WsCyLSZp2z7WzHZG3bHPzjnFnIpniXM/rOmRkmCujSSlaUKOnJZbO hzgxvF0YtAIreq5u5LOhmiUybWACHHA5IhGhNYr7grOPhB+7feMfeyXBvL0fIwY5 Y+7fowd6QINLnspdDQPvMLNS9aM+cGzkaYMVwKQX7SYE/moyvOzUFiCUuLedi1ZR q0FPsfN6+b0UqQ== =xPBh -----END PGP SIGNATURE----- Merge tag 'timers-urgent-2021-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fixes from Thomas Gleixner: "A small set of clockevent fixes which fell through the cracks before the 5.11 release: - Ensure a clock is enabled on sh_cmt - Trivial compile fail and compile warning fixes" * tag 'timers-urgent-2021-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined clocksource/drivers/sh_cmt: Make sure channel clock supply is enabled clocksource/drivers/ixp4xx: Select TIMER_OF when needed
This commit is contained in:
commit
4aa364443d
@ -13,7 +13,6 @@ config MACH_IXP4XX_OF
|
||||
select I2C
|
||||
select I2C_IOP3XX
|
||||
select PCI
|
||||
select TIMER_OF
|
||||
select USE_OF
|
||||
help
|
||||
Say 'Y' here to support Device Tree-based IXP4xx platforms.
|
||||
|
@ -79,6 +79,7 @@ config IXP4XX_TIMER
|
||||
bool "Intel XScale IXP4xx timer driver" if COMPILE_TEST
|
||||
depends on HAS_IOMEM
|
||||
select CLKSRC_MMIO
|
||||
select TIMER_OF if OF
|
||||
help
|
||||
Enables support for the Intel XScale IXP4xx SoC timer.
|
||||
|
||||
|
@ -131,10 +131,7 @@ static void mxs_irq_clear(char *state)
|
||||
|
||||
/* Clear pending interrupt */
|
||||
timrot_irq_acknowledge();
|
||||
|
||||
#ifdef DEBUG
|
||||
pr_info("%s: changing mode to %s\n", __func__, state)
|
||||
#endif /* DEBUG */
|
||||
pr_debug("%s: changing mode to %s\n", __func__, state);
|
||||
}
|
||||
|
||||
static int mxs_shutdown(struct clock_event_device *evt)
|
||||
|
@ -235,6 +235,8 @@ static const struct sh_cmt_info sh_cmt_info[] = {
|
||||
#define CMCNT 1 /* channel register */
|
||||
#define CMCOR 2 /* channel register */
|
||||
|
||||
#define CMCLKE 0x1000 /* CLK Enable Register (R-Car Gen2) */
|
||||
|
||||
static inline u32 sh_cmt_read_cmstr(struct sh_cmt_channel *ch)
|
||||
{
|
||||
if (ch->iostart)
|
||||
@ -853,6 +855,7 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
|
||||
unsigned int hwidx, bool clockevent,
|
||||
bool clocksource, struct sh_cmt_device *cmt)
|
||||
{
|
||||
u32 value;
|
||||
int ret;
|
||||
|
||||
/* Skip unused channels. */
|
||||
@ -882,6 +885,11 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
|
||||
ch->iostart = cmt->mapbase + ch->hwidx * 0x100;
|
||||
ch->ioctrl = ch->iostart + 0x10;
|
||||
ch->timer_bit = 0;
|
||||
|
||||
/* Enable the clock supply to the channel */
|
||||
value = ioread32(cmt->mapbase + CMCLKE);
|
||||
value |= BIT(hwidx);
|
||||
iowrite32(value, cmt->mapbase + CMCLKE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1014,12 +1022,10 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
|
||||
else
|
||||
cmt->rate = clk_get_rate(cmt->clk) / 8;
|
||||
|
||||
clk_disable(cmt->clk);
|
||||
|
||||
/* Map the memory resource(s). */
|
||||
ret = sh_cmt_map_memory(cmt);
|
||||
if (ret < 0)
|
||||
goto err_clk_unprepare;
|
||||
goto err_clk_disable;
|
||||
|
||||
/* Allocate and setup the channels. */
|
||||
cmt->num_channels = hweight8(cmt->hw_channels);
|
||||
@ -1047,6 +1053,8 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
|
||||
mask &= ~(1 << hwidx);
|
||||
}
|
||||
|
||||
clk_disable(cmt->clk);
|
||||
|
||||
platform_set_drvdata(pdev, cmt);
|
||||
|
||||
return 0;
|
||||
@ -1054,6 +1062,8 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
|
||||
err_unmap:
|
||||
kfree(cmt->channels);
|
||||
iounmap(cmt->mapbase);
|
||||
err_clk_disable:
|
||||
clk_disable(cmt->clk);
|
||||
err_clk_unprepare:
|
||||
clk_unprepare(cmt->clk);
|
||||
err_clk_put:
|
||||
|
Loading…
Reference in New Issue
Block a user