Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp879058lqd; Wed, 24 Apr 2024 22:15:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBRY3WJNHR9fnEkadkYOsY5s0ZpcK+sn7aZut9YTGYqHfuAqeKKGA4C1hivs5xCW+wAXmPYmbW8dDLXKVEbEXAgtMjHwAMwOfpmMLSlg== X-Google-Smtp-Source: AGHT+IHRM63Oy+uvAbE4sMeMtS4SYx2mMYakwDwrY0pkkK7tu4ssSsr66ASEzZhnUHcUeLjVoLRK X-Received: by 2002:a05:620a:848:b0:790:88fe:405d with SMTP id u8-20020a05620a084800b0079088fe405dmr4833558qku.45.1714022119478; Wed, 24 Apr 2024 22:15:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714022119; cv=pass; d=google.com; s=arc-20160816; b=iqpKRpJToloJxlPjKLnN0m4aa4n4cAJ8dzlVu4jBF4blp5toXXT+CDaHWP+vo9bxRh 6ErzyOQ02puu3PaEwwt5eoM5RCElz6S4TxNj2FIRgGh0CzwagDUDh+tMei+XIGe5R3R9 Q4zcUXR8G8M9SCgTfTQqLTquMgbDbdd6RzPG8FQWomS2TTQcPbmkx1ZRFJnQ5qEdchMA ukA/2czCGwTIw23xiwNqEwcpFGERGV0RwrR9gPbsgtWO6wgxsxmLhnI7iheWK/tUfm0i LpcG5ZZFLsTDDsvlygzV/WeaiBxLP3iaIe4qI7vVwk+heKMgcqmvhddMR7IrfGAMQsnF RhPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:cc:to:from:date:dkim-signature:subject :dkim-signature; bh=BPkT8A48a6oXi458YKzL+nQT48iFaKKVvkLsK6sfIQ8=; fh=wDRQOH5oTle5I7CydnHz/zJHunFYfmAMb7VTbfZ+FQg=; b=nIeKT8KCPAbvkmv7cRwShmypCMaITj/3wpXp+CxGippSBhiX5JVxp/mmaU39t8c+qm btzEyfSQ/lwqbZF1GV6WjnJorACqNkHt5liEslMZWVK+Jl3CpRQEeG4ESROruuQsldY2 8KK9uUylydF4f9ce2hHpQX4K22E1PXe0Hn20vIY5dO4P/IgUZ2YIQfIjdvIm6orpI6u9 z2JF0uVLpYGzgoqJ+BZprVEXs2jgfAuPxsjD/4QaloRe+cruWRqtpnRK1USsHQXNyZyC x9tmZibXtBatvMWghGmdae1JK//bgYam3H4/3YQmIReXsO382x3hw4YGJGnOXUYcpkz1 g4+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=PrmBRQtL; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b=F+makd09; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-158017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk9-20020a05620a1a0900b0078f0606c8fdsi18376915qkb.516.2024.04.24.22.15.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 22:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=PrmBRQtL; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b=F+makd09; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-158017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 39D8A1C21308 for ; Thu, 25 Apr 2024 05:15:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E49A33B78D; Thu, 25 Apr 2024 05:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="PrmBRQtL"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="F+makd09" Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3BEB2B9DE; Thu, 25 Apr 2024 05:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714022106; cv=none; b=LeSu7/Xbiql9sEO5XlGDX5NqiZi9TOYNkiiLRfgy8iMVy2Kq3aIXPyMXzR8QLhi/aP1WsuZN8YEHJ6mUVjA3bQfDmixyAoziPrQLWVXYypt/ydoop75zPDQ/2PBCMJBX5aHHQVv9jtzxcXFDpr9CdHgXQFXXYOXyrwconAXHY8c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714022106; c=relaxed/simple; bh=iW8ATjleso1uM6oVbDeQRVFxVXqLdoVu5uZ3W7y/49I=; h=Subject:Date:From:To:Cc:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RBvrbRzW7FjFVeibUmwGGNrCRutVuHuuVvOitVQlVulVMoiHsbd4B4pz06gcSt+rZVnzR5BNJzpIyaEnZBlDXh6bj9KEm9KU7vbqUaPFZ8+/cKGE8zHF/wIDtkmh45yoYeNqMwoK8gbsk8tiu8g2RbCyQC5XenW1ymGNuD6jgbg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=PrmBRQtL; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=F+makd09 reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1714022103; x=1745558103; h=date:from:to:cc:message-id:references:mime-version: content-transfer-encoding:in-reply-to:subject; bh=BPkT8A48a6oXi458YKzL+nQT48iFaKKVvkLsK6sfIQ8=; b=PrmBRQtLU18tGvtdRqNaPYzfIobbHNakJBzhgQMXr4AnfxDSPcouCN1U cjnyJdqaRkLxIBZDJNb5yP0JFW7KJXOSyDYf8n3J82uTGbmDIr6WfMJoT ntggT+DJP6TbH2zb80s3J6rY+ZMlKlCnJq278Bp4P0Nq69ehxKVKjwXkn UEqEQuFnk/UzyZSUHW/7Oj2AE2e8Mrx3k5Tirl49Yangx9slVPpykY+Mb qggJE4S21QzhkyNpWQS1T1nvZ0lM9P+NR5cS6twJZJJ819swwvysFo1pr 6OyYTBIkB5L+iKmwi8AyzPqSN/pJnzLd0mEErN/hJM66UU693ji4/iu4D g==; X-IronPort-AV: E=Sophos;i="6.07,228,1708383600"; d="scan'208";a="36602262" Subject: Re: Re: [PATCH 1/4] can: mcp251xfd: stop timestamp before sending chip to sleep Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 25 Apr 2024 07:14:59 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 55EDF16DDB5; Thu, 25 Apr 2024 07:14:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1714022095; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=BPkT8A48a6oXi458YKzL+nQT48iFaKKVvkLsK6sfIQ8=; b=F+makd09QV/2FCHjI+XH7QQZUn/V0xyGCU+yHRobL284y70ZbyQ4HJ5MCi1JEdH44/LEke e+OMl0VqEthNKUerZuKQa7fg7kX2EU4Fzx5lxoAakMZmySpqwxF2NhknjCxmGJA0T8tQu6 UMlF1Vs5ufb8H7YV9zm+fqt41XfF65pQ1k9FEbJ0V4ZntBJEyH4YZTGYHYLQBI68QRWI5G Nh1iRYig8X8WWc0t2Jsju9LeY6Q9Cu48ovC8XcxJgyL/TnkbPZUUNROfQeqccDpSqkHFet OC25z7vGqXNoaIgi32ZhBi6vEW34TJJuvV7TPi8k2tlB8YyVdRipv1GP+jCdPg== Date: Thu, 25 Apr 2024 07:14:47 +0200 From: Gregor Herburger To: Marc Kleine-Budde Cc: Manivannan Sadhasivam , Thomas Kopp , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux@ew.tq-group.com, alexander.stein@ew.tq-group.com Message-ID: References: <20240417-mcp251xfd-gpio-feature-v1-0-bc0c61fd0c80@ew.tq-group.com> <20240417-mcp251xfd-gpio-feature-v1-1-bc0c61fd0c80@ew.tq-group.com> <20240424-fast-sandy-jackrabbit-d289a0-mkl@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240424-fast-sandy-jackrabbit-d289a0-mkl@pengutronix.de> X-Last-TLS-Session-Version: TLSv1.3 On Wed, Apr 24, 2024 at 10:24:58AM +0200, Marc Kleine-Budde wrote: > On 17.04.2024 15:43:54, Gregor Herburger wrote: > > MCP2518FD exits Low-Power Mode (LPM) when CS is asserted. When chip > > is send to sleep and the timestamp workqueue is not stopped chip is > > waked by SPI transfer of mcp251xfd_timestamp_read. > > > > So before sending chip to sleep stop timestamp otherwise the > > mcp251xfd_timestamp_read callback would wake chip up. > > > > Also there are error paths in mcp251xfd_chip_start where workqueue has > > not been initialized but mcp251xfd_chip_stop is called. So check for > > initialized func before canceling delayed_work. > > Can you move the mcp251xfd_timestamp_init() (which starts the > timestamping worker) into mcp251xfd_chip_start() to keep things > symmetrical? I think then you don't need to check for "work->func" in > mcp251xfd_timestamp_stop(). > Hi Marc, I realise now I confused mcp251xfd_timestamp_init with mcp251xfd_chip_timestamp_init. The only call chip mcp251xfd_chip_stop without call to mcp251xfd_timestamp_stop is from mcp251xfd_handle_cerrif. So it should be sufficient to stop the worker there and the check for "work->func" can be also omitted. Best regards, Gregor -- TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider https://www.tq-group.com/