From patchwork Mon Jul 10 13:19:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 117917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp5020979vqx; Mon, 10 Jul 2023 06:21:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlF0y/Py3lL10HngiVsxdu10+Q/BhfyrcTSp4NfTEkxwvEkLUoYRDkwlEXzCG7EGfxBQVaDV X-Received: by 2002:a05:6a20:918f:b0:12e:ae1a:4c1c with SMTP id v15-20020a056a20918f00b0012eae1a4c1cmr17098325pzd.36.1688995260042; Mon, 10 Jul 2023 06:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688995260; cv=none; d=google.com; s=arc-20160816; b=vqjuQn1hNzcRZc1/8NkhSVwPyGDR0UrEysNFsCgycGktwYxAsxJ2Ro3BhVTKLab3Z3 uyVeMsUIuGAwzgMgfBSOoPpfGZ5ngoXdWsLRhpHpxQXKnBnN/U0LWub31bHSdD0V6D+Q YQXaRBRTP0dubh7ckAJ6RL+HP8VcK1NJ7LDSpiXgN2hwHchDxeT42ahmpZF6F6YuwZtO MFWEhen8FDPHwHZ72+V/emxljGL3f9EcrgepUV7P7Yraz55HOHpkk2CItxhEate/Kc6s 6A3p+2egC5Pbs2R23rGhAJcTNXlGK3cizPq2/dAk5U9pSAFVLN15A004Fgl1iPDsRzhQ dYOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r1gRBue3D63AcisS8ZRrKq/nAe8+ybrtdsVfAzlr1PY=; fh=WN0+3l9+YGOB5g+QlA4rwbCLEE0/87q/BuWOFyK7rKU=; b=TmGqCcmOhnpNGVR9gPL3XywXvJ9eh9s9ZCcheVSEvDkjnKZo3Qyvu5udwhZwGamPc9 xb+YKQylHK0REDelQMXek8hYWHSr6VtMXq/6cdjzeo5T+i6WK5SDJtLbEuuzU8X1/f/T J1j21eYZyRA/0qRq3ojPL0IRaJ3tRk4xHdCQ+0zyFQJ4yJti2MoGwE7cBcur62OdD6pC LuU7EO3l7O0FFTcJMlb35+DE3wvSAwY8p0ZRhKstLlLPSjooZu+M1jyEArcSl58S7cVt 5NsjQyRYbHjdPF9u6o0hao7/gBdriZcbx72TnrjN5mdpzPkY7XaGqtyxGw4Vxprf3NS6 tbzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=pA+OZj+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a170902cec400b001b9e68c22bdsi1085204plg.187.2023.07.10.06.20.47; Mon, 10 Jul 2023 06:21:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=pA+OZj+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbjGJNT3 (ORCPT + 99 others); Mon, 10 Jul 2023 09:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231179AbjGJNT2 (ORCPT ); Mon, 10 Jul 2023 09:19:28 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EEF1C4 for ; Mon, 10 Jul 2023 06:19:26 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-77ac14ff51bso142735739f.3 for ; Mon, 10 Jul 2023 06:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688995166; x=1691587166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r1gRBue3D63AcisS8ZRrKq/nAe8+ybrtdsVfAzlr1PY=; b=pA+OZj+6VRBv5gS74DBiOVUTgwvqM6wfhrRwlQNZG7tF+0mRI9MD1owZvdSX7ukimh k8suDBs0QgKceGAu3WuWnG43cRnQhiCgUbXPnkIEICLi1FX3T2OtPFwSpBDYcJqYySgt 8mew5dOHk8HZ5c1QM7tS98XYN0MyH0n0xs+ZuFNgCNoZPS0u8LbWovuZ4i9/NUmQyg4n fbtlVo8iSDEAMIIdt218mawBd6L7r00CCJnYonLgqo8KA3BEgoQ3XASlfTOPoyfp3UdI pJThRWHkf8gbMgSucIu3KeJySWz3zR+8VUhz1cFP0/2GWDgOPQyx09LmmXuGwk7LWPuD qXTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688995166; x=1691587166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r1gRBue3D63AcisS8ZRrKq/nAe8+ybrtdsVfAzlr1PY=; b=NqqGR1M6E/V0UJb9LMpje0nBy7dS170o8cine1WZq253HfAwoP8KChZXIJgbNNQXpi r3Lkhp2Tx2SMllqmx0Ujdf8I/9NsK54UAtvgKH40pYS3AtyttioH5p4cKQ4eYBKXUtKn k/qN4xgbvNGHnjDKREtIuzf/7meJ2428wlAHAJkT0aMiVOmjDkzOiPcpMmzaNQJ94Px+ wdXFCriiW8sCJNh7YswfVJuXKU7x0DAKwSx0F7Hox5627oJazYJA3GOxaKgKRSVKIp23 xJLMylTdoX4Yky38fJ6dkhf40TDa6L4L9/gZ4wkrFp2HHbQmelggWD89CEblnrvmZyUm O9YA== X-Gm-Message-State: ABy/qLaWeAMpkcHLrFHA5J+OkEYJ41iPz4v2mwUatSW8eIA8/gmtreS2 MdDXQ9wRXNCjY/1mTnggiRvZ2g== X-Received: by 2002:a5d:9451:0:b0:783:72b9:ed67 with SMTP id x17-20020a5d9451000000b0078372b9ed67mr12562805ior.10.1688995165630; Mon, 10 Jul 2023 06:19:25 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id q14-20020a5d9f0e000000b0077a1b6f73b9sm3643242iot.41.2023.07.10.06.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 06:19:25 -0700 (PDT) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Daniel Lezcano , Thomas Gleixner Cc: Atish Patra , Andrew Jones , Sunil V L , Conor Dooley , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 2/2] clocksource: timer-riscv: Increase rating of clock_event_device for Sstc Date: Mon, 10 Jul 2023 18:49:02 +0530 Message-Id: <20230710131902.1459180-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710131902.1459180-1-apatel@ventanamicro.com> References: <20230710131902.1459180-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771039893767201463 X-GMAIL-MSGID: 1771039893767201463 When Sstc is available the RISC-V timer clock_event_device should be the preferred clock_event_device hence we increase clock_event_device rating for Sstc. Signed-off-by: Anup Patel --- drivers/clocksource/timer-riscv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index f2ea2b3d2d43..9c8f3e2decc2 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -105,6 +105,8 @@ static int riscv_timer_starting_cpu(unsigned int cpu) ce->irq = riscv_clock_event_irq; if (riscv_timer_cannot_wake_cpu) ce->features |= CLOCK_EVT_FEAT_C3STOP; + if (static_branch_likely(&riscv_sstc_available)) + ce->rating = 450; clockevents_config_and_register(ce, riscv_timebase, 100, 0x7fffffff); enable_percpu_irq(riscv_clock_event_irq,