Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp779447rdb; Sun, 1 Oct 2023 05:23:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/lfKSrxVjIRMjQ1YCMs3xaaXSJY1hvN3DzmPp8C4EUAEIKRBzgQrUrz9QZyA2kfAoKB6d X-Received: by 2002:a05:6a00:1ac7:b0:682:537f:2cb8 with SMTP id f7-20020a056a001ac700b00682537f2cb8mr10203790pfv.26.1696163009563; Sun, 01 Oct 2023 05:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696163009; cv=none; d=google.com; s=arc-20160816; b=PCiCM1kKkfzHpckfL9ZpjoGD5q9aJz0zGZvfpF459+zWkOM1ZXLsWq2mXVWzsmYX0x 4xiN7eZEdDckH+/AHV4IEO0vP6hIPQs7cjp1ug5HwnWH9AtGxDgkZ/f5CvhqwjCuQq7W kTxhfdpGJr4Bbii80e04/rsdB4VIhv3s/IAbhkOvPk2dEJkfO1yblb/MED51DnzLpWr1 HHBDaCFrtgqUqB7GTCifh4pZymph53IONYe+AXd2h8dnATbPYyIRJVFS12P77OQc7YT2 tjVEpjCZn2y32kEq4uAvIdzoWoykmfynSJLd6do/XChTOeJzvjciaM78KJ9KJVMh65A8 qfhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=In4iE/IG67FstPm44Rdo/zZ/AU63PkS7Rrr6kxmiNLU=; fh=9X4NRy2Om8pBMDZwTDDMWWOq9JUj1HYOE9bwpsR/7YI=; b=gekdrsk/1CB0c/FVirODr26pUEkuSgTTrUWka1LXYuAAUJjQJEaArDYtrBNUhyhbKP Z3I1DV+HMvm+PBPBSoa1/2ElrLJcysWhUn1PYHEsGnD4g2d5lKd5UXYYwBZXImGuppRf fffxjl85Wrc7KdpwM51jA7DcxY0yBotA5EmcWFz+rRTK9B5SpXMvEvgvrJUauoI9/Ovh 5yvlPFqBORJXysokeAallv1CwWEJg115K8Hgp2PtSEIpCTOckya7xFtROhN6/NqJr3D8 bl5Bv+AkJWMhdShSY7CFoVmVv3/CaMctGyyzqvIaZH+jbgLHFbD7Eg2V0lrL153WzMzK WZkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c8YO6GTk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ea28-20020a056a004c1c00b00686baf235easi9148405pfb.258.2023.10.01.05.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 05:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c8YO6GTk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7114680241B0; Sun, 1 Oct 2023 05:23:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234944AbjJAMXY (ORCPT + 99 others); Sun, 1 Oct 2023 08:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234911AbjJAMXX (ORCPT ); Sun, 1 Oct 2023 08:23:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F389E; Sun, 1 Oct 2023 05:23:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E68F6C433C8; Sun, 1 Oct 2023 12:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696163001; bh=cw7CS63l0RAvgmBKjdZgE6Zr9SOJsQukYNn5TfNmzr0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c8YO6GTkfcj4JiT/lH4zt0qDUd2lojUD8TpeAx+1zp7uWa9ifFLdGKzh7y1z6lhsW CDk08CMgP+W9YzEAGGKPzJHTsrBor8YENr+PsefYeTUusTDE1ln4Kx4o0/D8LlrZUE a7kxz+bseGR8Gf+mW8ZgDIcCu57ht0VFowX4cLurZvtvuXeU3oc3ku32I2I1KeGJdb HEO6YDCSeRJ2a3f3xBJ1W2tc8fNDyxmeir8lGm9rMXJdK8jYt+0Fxsd+gBnniSgZX4 g7Qs4SLCDj4AopzW/FqrxBPbsWb0WRWUwbA/YsbMGchSFPXt2EMvvbTUKmJlZezEku vbbH09vxKxuuw== Date: Sun, 1 Oct 2023 14:23:16 +0200 From: Simon Horman To: Markus Schneider-Pargmann Cc: Marc Kleine-Budde , Chandrasekar Ramakrishnan , Wolfgang Grandegger , Vincent MAILHOL , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Julien Panis , Judith Mendez Subject: Re: [PATCH v6 04/14] can: m_can: Implement receive coalescing Message-ID: <20231001122316.GL92317@kernel.org> References: <20230929141304.3934380-1-msp@baylibre.com> <20230929141304.3934380-5-msp@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230929141304.3934380-5-msp@baylibre.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 01 Oct 2023 05:23:28 -0700 (PDT) On Fri, Sep 29, 2023 at 04:12:54PM +0200, Markus Schneider-Pargmann wrote: > m_can offers the possibility to set an interrupt on reaching a watermark > level in the receive FIFO. This can be used to implement coalescing. > Unfortunately there is no hardware timeout available to trigger an > interrupt if only a few messages were received within a given time. To > solve this I am using a hrtimer to wake up the irq thread after x > microseconds. > > The timer is always started if receive coalescing is enabled and new > received frames were available during an interrupt. The timer is stopped > if during a interrupt handling no new data was available. > > If the timer is started the new item interrupt is disabled and the > watermark interrupt takes over. If the timer is not started again, the > new item interrupt is enabled again, notifying the handler about every > new item received. > > Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Simon Horman