From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Jul 2013 21:22:37 +0200 (CEST) Received: from mail-pd0-f169.google.com ([209.85.192.169]:63714 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6827280Ab3GaTWYmOsx6 (ORCPT ); Wed, 31 Jul 2013 21:22:24 +0200 Received: by mail-pd0-f169.google.com with SMTP id y11so1117951pdj.14 for ; Wed, 31 Jul 2013 12:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/LsFLiozx6360zatOgzF73MkInT4FcrZfMgBxH8VIhg=; b=Jh1W1cXOYdZuH0c8bOuC/VwAhRd0o8Igs3vbVioA8xskA6Uyp2riqc+J7jTrfvXkCk up8H7XMpR08DqLtDzBxxziXxS3pBGZvFqzqVKhF0DJ0vjOQ8k3azp/hc7oxWn9UM5cah BnG/1A6oW74zxmW6u7vvJ7EJhjSgns8zb4vmQMWKhmcYw+QlZl5Qg0x2pSmOyf0SXpVU cPQGJT9EFXjLjZVofglJoWe27fHAIhQmnpJcVRzR1sAtoNS9x4cs/9M5zLsVhTELFM14 iASCfCl1YAEandeTxY4RKcJyqWJYD+ioRzopOKTf4KAXP9OT7fcEF5d2QTUpel/0Sm0a AAaw== X-Received: by 10.66.2.164 with SMTP id 4mr83617820pav.55.1375298538069; Wed, 31 Jul 2013 12:22:18 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id bg3sm3716084pbb.44.2013.07.31.12.22.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 31 Jul 2013 12:22:17 -0700 (PDT) Message-ID: <51F963E7.50407@gmail.com> Date: Wed, 31 Jul 2013 12:22:15 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Florian Fainelli CC: John Crispin , Linux-MIPS Subject: Re: [PATCH] MIPS: add proper set_mode() to cevt-r4k References: <1375091743-20608-1-git-send-email-blogic@openwrt.org> <51F6495D.9000008@phrozen.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 37408 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ddaney.cavm@gmail.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On 07/29/2013 04:14 AM, Florian Fainelli wrote: > 2013/7/29 John Crispin : [...] >> >>> 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. > I might as add my $0.02... There are many other clockevent drivers that do this type of thing aren't there? The clockevent framework uses this to install/remove/switch drivers, so why should cevt-r4k not be made to work like this? David Daney