linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: add proper set_mode() to cevt-r4k

To: John Crispin <john@phrozen.org>
Subject: Re: [PATCH] MIPS: add proper set_mode() to cevt-r4k
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 29 Jul 2013 12:14:36 +0100
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=1EbEhixjRc60zwmHRqZInO8iVp3fu0elb7/i9wPElKg=; b=0LsH9/pIgMOTO6nBQaGEzkTa3gJVhSSRCMVgw2vRrCxPflwN3jv26+kqjAZCtEJDXd oV1sj67C1PyuF5IO+BnfKWumHNCMjwEq5q/UwPLgwV2DkIVFN9DOC/MuiX3Ce6l2WU6u rF8xxz/DZHZ+UbQebQAsbSEi8kc0On+zhPpPl97LrC7qPhQQv8jobAEvlHvwNzSzMcmk ZVeNutA2lxJnBodxVMuXRQjYCrusv8j1rspIACaKkfu5w9fkiv2FTYArjvHtZi0wJCUe InkazPIf/YUmK8jLGQ1Jx0PUlZb99+iVFzLw6XXOu1KoZMbh+Sw/dtr/ERogoQOdYCcV WQjA==
In-reply-to: <51F6495D.9000008@phrozen.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1375091743-20608-1-git-send-email-blogic@openwrt.org> <CAGVrzcYXyWB1bwoKyEFrSO7YEJx9Q_v2vOnnPnqVrFVKiigFrA@mail.gmail.com> <51F6495D.9000008@phrozen.org>
Sender: linux-mips-bounce@linux-mips.org
2013/7/29 John Crispin <john@phrozen.org>:
> Hi Florian,
>
>
>> It is not clear to me whether this secondary cevt is also a r4k-cevt
>> device, or if it is something else? If the IRQ is shared, is there any
>> way to differentiate the ralink cevt from the r4k cevt, such that both
>> could request the same irq with the IRQF_SHARED flag?
>>
>
> IRQF_SHARED | IRQF_TIMER is not allowed as a combination.

Good point, forgot about that. Then how about a way to let a platform
specify its own callback? Pretty much like what is done with the
handle_perf(r2) case?

>
>
>
>> It looks to me like you are moving the irq setup later just to ensure
>> that your ralink clockevent device has been registered before and has
>> set cp0_timer_irq_installed when the set_mode() r4k clockevent device
>> runs, such that it won't register the same IRQ that your platforms
>> uses. If that it the case, cannot you just ensure that you run your
>> cevt device registration before mips_clockevent_init() is called?
>
>
> i dont like relying on the order in which the modules get loaded.

plat_time_init() runs before mips_clockevent_init() and the ordering
is explicit, would not that work for what you are trying to do?

>
> the actual problem is not the irq sharing but that the cevt-r4k registers
> the irq when the cevt is registered and not when it is activated. i believe
> that the patch fixes this problem

Your patch certainly does what you say it does, but that is kind of an
abuse of the set_mode() callback.
-- 
Florian

<Prev in Thread] Current Thread [Next in Thread>