Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3764900pxv; Mon, 5 Jul 2021 05:17:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrjxvY1KmB/7NDSUyIMyIZbxsAHMNC6lNL8ps+2T8Dp8TmEIwPhNkQNfsXxtpF4ZzZXV+5 X-Received: by 2002:a05:6402:520c:: with SMTP id s12mr16296652edd.357.1625487455636; Mon, 05 Jul 2021 05:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625487455; cv=none; d=google.com; s=arc-20160816; b=oyopf8q4Qn3p8mx5/htDPpma9ee+3pGd2Jo4P3QCnSTRBs+e4V2OLxOtVz6vN/5q32 b00FE6M6MLtd6v/X3myrMpP4KIF3OBIP9UqHdMLsn1GSIwWyWd56kn457KAXIy5xsusf FT6NevFAvrawMYtAlDil89zOQ4GX2VWtTOwfr7iXbBHtc7H0URK6Seoq0aAfmeuOt+vQ p0G7PPxnm3kEVEotOZJIBkPdMpKmSWTEo+Neu2y+cLjUAPMdLgxE9F7UMEuEX6P7AlTe MOhqUvBgSKRZbMR/KJIS8wFLytniBMM5n5SVpllsTp3hsOlE/xV76lQBtpEXtptDZQPN 99Sw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=46q8UclYEn65a49RzxpKI/3dVSD5yV+XW8jxkT70lDk=; b=Gwp27xFfofkOs72gZ4DBc6KrkddTePaNPpl7LXjmhfUdpaYFxNY3FbncKUNstQoYAq zxCBNFb29x2VKOj7MfFNUE9IJ3+n62B7vCZSGFZ4Rl+NISdgHhBXKJ/Xs44caOfNd46o LhYya7x1JWgHUwhqvi1CAIpZLcN3Dp9K5AxHKtY7t3pMgiRqY9N0aiFqiOagCOsn/tsh VTztltM1zZgFI9oSfVi55bmb4ryeBM8EG7gIq8FEWdWftIAdYME2Gm6eB7+hN16y2iWw +3SbNj+h5VQ0yFjsEeoiNfWKqtnHcHhdiqoz+bUTtXroExJkcGBG+FJpROzYXzDQk78e BUDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LwLfYCWK; dkim=neutral (no key) header.i=@suse.de; 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 cb13si10555809edb.298.2021.07.05.05.17.11; Mon, 05 Jul 2021 05:17:35 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LwLfYCWK; dkim=neutral (no key) header.i=@suse.de; 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 S231283AbhGEMQj (ORCPT + 99 others); Mon, 5 Jul 2021 08:16:39 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:38380 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbhGEMQi (ORCPT ); Mon, 5 Jul 2021 08:16:38 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1A4B41FE5C; Mon, 5 Jul 2021 12:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625487241; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=46q8UclYEn65a49RzxpKI/3dVSD5yV+XW8jxkT70lDk=; b=LwLfYCWKW/+5x3vgXSk4vBGsNTUGns4tt3Ud3OyKzn7K5g+KzJYN8Yu07Ynr8pqE4+z30E MZyclKrwb6AFIM9xtCy1Q5JIGshdf+CLJ1YhIDTkzWgI6o9ibc9SS3V0mYkyiqhbqL+eEj gtnOoUcSEAvihBdV74gm4+zm+HxGxe8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625487241; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=46q8UclYEn65a49RzxpKI/3dVSD5yV+XW8jxkT70lDk=; b=NTXYH5qbA8GHY18kHZKtGWZKIrplep033FoShY4rOZHApntK9+lG4iZ+jcKmqkOOArqKSD 5j0pF7pKadwqBnBg== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id D301B1367E; Mon, 5 Jul 2021 12:14:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id j9VzMYj34mCaFQAAGKfGzw (envelope-from ); Mon, 05 Jul 2021 12:14:00 +0000 Date: Mon, 5 Jul 2021 14:13:55 +0200 From: Mian Yousaf Kaukab To: Bruno Thomsen Cc: Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, open list , biwen.li@nxp.com Subject: Re: [PATCH v6] rtc: pcf2127: handle timestamp interrupts Message-ID: <20210705121355.GA82146@suse.de> References: <20210629150643.31551-1-ykaukab@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 08:26:04PM +0200, Bruno Thomsen wrote: > Den tir. 29. jun. 2021 kl. 17.06 skrev Mian Yousaf Kaukab : > > > > commit 03623b4b041c ("rtc: pcf2127: add tamper detection support") > > added support for timestamp interrupts. However they are not being > > handled in the irq handler. If a timestamp interrupt occurs it > > results in kernel disabling the interrupt and displaying the call > > trace: > > > > [ 121.145580] irq 78: nobody cared (try booting with the "irqpoll" option) > > ... > > [ 121.238087] [<00000000c4d69393>] irq_default_primary_handler threaded [<000000000a90d25b>] pcf2127_rtc_irq [rtc_pcf2127] > > [ 121.248971] Disabling IRQ #78 > > > > Handle timestamp interrupts in pcf2127_rtc_irq(). Save time stamp > > before clearing TSF1 and TSF2 flags so that it can't be overwritten. > > Set a flag to mark if the timestamp is valid and only report to sysfs > > if the flag is set. To mimic the hardware behavior, don’t save > > another timestamp until the first one has been read by the userspace. > > > > However, if the alarm irq is not configured, keep the old way of > > handling timestamp interrupt in the timestamp0 sysfs calls. > > > > Signed-off-by: Mian Yousaf Kaukab > > --- > > Sorry, once again compile tested only due to lack of hardware > > availability. Hopefully, I will be able to do some real tests tomorrow. > > Hi Yousaf, > > I have tested patch version 6 on an imx7 board with the pcf2127 > chip using SPI interface and no alarm IRQ in the device tree. > The same board that produced an oops earlier, and now it's working > as expected. Both tamper events that occur when the device is > powered on and when an event happens with the device powered off. > > Reviewed-by: Bruno Thomsen > Tested-by: Bruno Thomsen Thank you for reviewing and testing the patch! I have tested it with alarm irq configured and it works fine. Alexandre, is it still possible to queue for v5.14? > > /Bruno > BR, Yousaf