Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1442278pxk; Fri, 4 Sep 2020 09:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztlBS4WHvOjlHi5irCDxG3LoY7q19CdBnaTXtz6L+8THAidprMTPF/7k1VxrT5gffHr/IB X-Received: by 2002:aa7:c987:: with SMTP id c7mr9680304edt.385.1599236793446; Fri, 04 Sep 2020 09:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599236793; cv=none; d=google.com; s=arc-20160816; b=PM8b0ijLWVW3e5P2zfjRhUVmrrikF9LiMNN7lH9+z3+D6LVR7Tggf+1wGWh1urqQlE yUj8iiay2hzmeh08CsSuVLqYjPru4kQvGzA9opX+Ir7mwlM+MtAT/RrDoehaC0HRZw2S LZHj9iAF7OA00aOgAaMT5L5kxL2cPhF6O4Y/bBIbTJxHFJYXIGuhZDX8Bl7nrxkWF5Mw wZ7C3z2Zv8RIuVJPNYnF2y6cyYTnnyju41cOllm76caICO9w04ud55P4+TRZ0oRpKBbH zczEz/5AE2ja3HoH/TuoDQT2/xfRRejftbRXZ5r5AqZgEyiiA0iMgYBN+iODSbrlW0rD OlSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=d9KHYZ/hnQ710BoYpocruCh5yRNWL/Cp61mHZmF30B8=; b=MREkOMTnL8Mzl+AOZ0/TCTpFA306LEMZp2V6M8zZjhrUhPoJQ5eDoeuoczsZB9AjNi 6yLzQs8BCAv1ZKDuu8OROh//CzMlWf8acP7tI9TkjKG6a+BtwqEkruFljmMpjjUM0KGP T4Y7cNEluNApXdrW0T0cJUueGhSaZJ49DC0nCzD/5eIpNF3P3Y5cpO8OUA7FgpD//TRQ DztSfRz+wnOMC6DRMyQpTob60PwU64kOgTLDy6EDbqgGI3U+1blYr6Iva/ODzdtFrrMe 9FzXuMpkxq0yWJH31o1dq/fK13Z30RrW0Awyy1tGNtKbQdkg/NACWDxfNlfOqCOaMHy5 jb6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si4275965edn.432.2020.09.04.09.26.08; Fri, 04 Sep 2020 09:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726235AbgIDQZe (ORCPT + 99 others); Fri, 4 Sep 2020 12:25:34 -0400 Received: from verein.lst.de ([213.95.11.211]:42475 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725984AbgIDQZd (ORCPT ); Fri, 4 Sep 2020 12:25:33 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 84B6A68BEB; Fri, 4 Sep 2020 18:25:30 +0200 (CEST) Date: Fri, 4 Sep 2020 18:25:30 +0200 From: Christoph Hellwig To: Anup Patel Cc: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Albert Ou , Atish Patra , Alistair Francis , Christoph Hellwig , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RISC-V: Allow drivers to provide custom read_cycles64 for M-mode kernel Message-ID: <20200904162530.GA32095@lst.de> References: <20200904162121.279578-1-anup.patel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904162121.279578-1-anup.patel@wdc.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 09:51:21PM +0530, Anup Patel wrote: > The TIME CSR is usually not present on most RISC-V systems so the > M-mode firmware will emulate the TIME CSR for the S-mode (MMU) kernel > whereas the M-mode (NoMMU) kernel will have to use MMIO clocksource. > > Currently, the get_cycles() implementation in asm/timex.h does not > consider the above fact so we provide alternate implementation of > the get_cycles() for the M-mode (NoMMU) kernel which expects drivers > to provide custom MMIO based read_cycles64() method. Please just go back to the previous working version without all the crazy indirections. The whole timer and irq code has been turned into a giant maze of indirections lately.