Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp268631lqd; Wed, 24 Apr 2024 01:25:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvzJaGjuYCJZ6GBD1GWZCAW+IzlCFfAaceaY5E4jJ7vTShuaIiqoBld1DWxMNMU/aPRJsCZa33RzRnBWHLHzKdDH0f0N/iAdx+DhdrvA== X-Google-Smtp-Source: AGHT+IETLNizDlwHPTFkvrkT/u/ErWHn3nm6jQCm+WRF2tNuXVE3kYf55rZa7jP25uHAOJ3n4kvo X-Received: by 2002:a25:ce82:0:b0:dda:a7e5:e4f0 with SMTP id x124-20020a25ce82000000b00ddaa7e5e4f0mr1742529ybe.61.1713947129709; Wed, 24 Apr 2024 01:25:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713947129; cv=pass; d=google.com; s=arc-20160816; b=BYzZfi/+QYZrfhMj05E+9IpTyc/L5fnS/CUoqkkkf5p5Svu/8Nn3HVqhjuA5BCz1xe X8l72K5CLk7Y5FHZDaUiKwZpuqDJ+nCc7RbmVdZJHlzjPh5vtlwE036tZC8Sj4OSKgy8 esS/wXwQCM6YBLtSIXCVRHkGx95uwxqNDvsVuUsnmbMSPucQduPrHs5xLM4plCLWY3lK /3Tb4VzGyQq4WyqiucGSGKyGhFgaE2Fa2PDHemIjvFksyCW48DZkpxEyFfX2jnLt67vd 7i9E+u/NUI4g/058YQbakAk1zAaKsSuR/uC3CqpPX03qphIxgWYUxJw5tATnEL4MliDd vkPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=JYm75lI1IXvVVrLNVSx7Cok7pJP4+vZcD+BDQ0G2WbE=; fh=t/Rlprtb5kVZgOj4jZz3MBiSXVd5jcjJfSKVyh9eDy8=; b=WSLMyW28WQ3XD7u9EorgWygUUheX7P6gpO5NSDK0+q5ovGnQyO+L5JRS0JrOovQRWj hLcjGOe07ih4z+e+v48oPEfUgrgUuOxGRkg64LDIL8OodbuX+0vFL8DHe8Anz8On4q0k 8SKXgz/uRTM1+AtbADogGbO/1nGZEuE5LFTwFeAohYdfA3wkCKWqnRPAyAvQqA8J4PxF UE5F4WCWI0zyfUvJ8yZvszuCnfEH5hIAZ5xuWb5tOD4aEvJ02Ibju4eGxnQ7U8hBEJVv 5dZHJYoS5IAvwNBm3CCXwKixHZRKytUUs38poUkVN58LYlWY5feQ3ZwXkSdcU2MTGVud p3Lw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-156537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156537-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f3-20020a0562141d2300b006a066a24fdcsi10636865qvd.60.2024.04.24.01.25.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 01:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156537-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; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-156537-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156537-linux.lists.archive=gmail.com@vger.kernel.org" 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 444421C2325D for ; Wed, 24 Apr 2024 08:25:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61366158A18; Wed, 24 Apr 2024 08:25:17 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 78826158871 for ; Wed, 24 Apr 2024 08:25:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713947116; cv=none; b=XonTcBxRaK8/xfKIz6fxOmFDfFpzRcYMqBjn21jPF66rPYLUNEUG+LH5kcFJs2CMUapx79k8YF/gxqR8QWRInRDtjTGmaudnLA38LbI+e7P5GOzeHEHPKpH54MGV0nyu1q4CiMK/xXYwdUhMD6Is2kvs1P/ZW5j4UsiB8x28czI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713947116; c=relaxed/simple; bh=NeIENiopGqRCJKXoxGR47faLpfIOQmosSOdAybtLZ1g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rqd+rVcPTxTxmOvBx1PlmJd6YBSAvzxr8ptRmf4PFtqsvLEffNupxJ2rL5B7A0z6J9D2UsTsAzCCi6TatG7T29YJPV+6sPUMbfOjw43MlRQA86F20QPo4flDcdbwex/f7v2v/kHbk1k66+ZcSfuWn6evnZ6/1zu0IyqTCgavHKA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rzXw4-0004x8-5q; Wed, 24 Apr 2024 10:25:00 +0200 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzXw3-00E2rV-Ic; Wed, 24 Apr 2024 10:24:59 +0200 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 23B652BEC37; Wed, 24 Apr 2024 08:24:59 +0000 (UTC) Date: Wed, 24 Apr 2024 10:24:58 +0200 From: Marc Kleine-Budde To: Gregor Herburger 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 Subject: Re: [PATCH 1/4] can: mcp251xfd: stop timestamp before sending chip to sleep Message-ID: <20240424-fast-sandy-jackrabbit-d289a0-mkl@pengutronix.de> References: <20240417-mcp251xfd-gpio-feature-v1-0-bc0c61fd0c80@ew.tq-group.com> <20240417-mcp251xfd-gpio-feature-v1-1-bc0c61fd0c80@ew.tq-group.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rqbw5j2wn4qgc634" Content-Disposition: inline In-Reply-To: <20240417-mcp251xfd-gpio-feature-v1-1-bc0c61fd0c80@ew.tq-group.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --rqbw5j2wn4qgc634 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > So before sending chip to sleep stop timestamp otherwise the > mcp251xfd_timestamp_read callback would wake chip up. >=20 > 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(). Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --rqbw5j2wn4qgc634 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEUEC6huC2BN0pvD5fKDiiPnotvG8FAmYowdcACgkQKDiiPnot vG/p/Qf/TnaEbLVI0x6Nv/Y79Ua6wtUkcJzzxBEoGz9HPhHdw/dLMVrLdK9WGHwu wQFssYbY/vrV+ro2S120SzM69VfAKZY49Ouee0bq5C1zrxqjJRpO1Axj7lV8kCX8 x2LUUxnbL1Ga1NWJLR+Z+y4nBY/LZotSIGohDemQhScfL5cAGkz/ZyoU58rt6zxM stvz8zMtJQmkprU6LH3MWr8MT25hj3T9OW9WAkjlqT30VCfuYvsRYqmJw+MsNIPd iqoMDYIYZyHKqTBfciDfEhZVPJzLQQtn0H5EBfG+yq8GH8QE4MvPuOWCd371+Sil XomSJ6I2QI5SFbGP/Wh3KfwoMXnEtQ== =GzL3 -----END PGP SIGNATURE----- --rqbw5j2wn4qgc634--