From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com. [210.118.77.13]) by gmr-mx.google.com with ESMTPS id u66si796421pfa.2.2016.02.18.00.51.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Feb 2016 00:51:04 -0800 (PST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2Q00K8HJ90TE20@mailout3.w1.samsung.com> for rtc-linux@googlegroups.com; Thu, 18 Feb 2016 08:51:00 +0000 (GMT) Subject: [rtc-linux] Re: [PATCH] rtc: max77686: fix irqf_oneshot.cocci warnings To: Valentin Rothberg , ldewangan@nvidia.com References: <1455782816-5814-1-git-send-email-valentin.rothberg@posteo.net> <56C57D1E.805@samsung.com> <56C584CC.2000104@posteo.net> Cc: kbuild-all@01.org, alexandre.belloni@free-electrons.com, javier@osg.samsung.com, cw00.choi@samsung.com, a.zummo@towertech.it, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, kbuild test robot From: Krzysztof Kozlowski Message-id: <56C585EF.6030509@samsung.com> Date: Thu, 18 Feb 2016 17:50:55 +0900 MIME-version: 1.0 In-reply-to: <56C584CC.2000104@posteo.net> Content-type: text/plain; charset=UTF-8 Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , On 18.02.2016 17:46, Valentin Rothberg wrote: > > > Hi Krzysztof, > > On 2/18/16 9:13 AM, Krzysztof Kozlowski wrote: >> On 18.02.2016 17:06, Valentin Rothberg wrote: >>> From: kbuild test robot >>> >>> Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") >>> threaded IRQs without a primary handler need to be requested with >>> IRQF_ONESHOT, otherwise the request will fail. >>> >>> So pass the IRQF_ONESHOT flag in this case. >>> >>> Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci >>> >>> CC: Laxman Dewangan >>> Signed-off-by: Fengguang Wu >>> Signed-off-by: Valentin Rothberg >>> --- >>> drivers/rtc/rtc-max77686.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >> >> Nack, because: >> 1. AFAIR this is a false positive. > > Looking at kernel/irq/manage.c +1250 such requests will be rejected > unconditionally when the primary handler is NULL, except when the chip > is marked to be oneshot safe. > > Is there another semantic that I am not aware of? In case the script > produces false positives, I will change it immediately. The handler is "irq_nested_primary_handler". >> 2. Was it tested? Was it reproduced? Was the bug actually spotted or >> just coccicheck pointed this and you assumed that "request will fail"? >> >> Coccicheck is a great tool... but not necessarily for pointing run-time >> bugs. > > I did not test it. To me the issue rather seems seems like something > where Coccinelle is really good at, static analysis. Yet, this is somehow subtle (device inter-dependencies) so it falls out of static into runtime (I mean runtime analysis is needed). Best regards, Krzysztof -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425566AbcBRIvF (ORCPT ); Thu, 18 Feb 2016 03:51:05 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:32565 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425227AbcBRIvD (ORCPT ); Thu, 18 Feb 2016 03:51:03 -0500 X-AuditID: cbfec7f4-f79026d00000418a-6a-56c585f4e442 Subject: Re: [PATCH] rtc: max77686: fix irqf_oneshot.cocci warnings To: Valentin Rothberg , ldewangan@nvidia.com References: <1455782816-5814-1-git-send-email-valentin.rothberg@posteo.net> <56C57D1E.805@samsung.com> <56C584CC.2000104@posteo.net> Cc: kbuild-all@01.org, alexandre.belloni@free-electrons.com, javier@osg.samsung.com, cw00.choi@samsung.com, a.zummo@towertech.it, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, kbuild test robot From: Krzysztof Kozlowski Message-id: <56C585EF.6030509@samsung.com> Date: Thu, 18 Feb 2016 17:50:55 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: <56C584CC.2000104@posteo.net> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42I5/e/4Fd0vrUfDDDp7ZSyWXLzKbtFxbTGT xfUvz1kt3j9fz2zx5u0aJovXLwwtjl2fyGyxdN9qFovLu+awWezv7GC0aFov6cDtcX8vu8eT TRcZPfZMPMnmsXjPSyaP3uZ3bB5b+u+yezw+fJLdo2/LKkaP6fN+Mnl83iQXwBXFZZOSmpNZ llqkb5fAlbFp1kvmgll8Fdfvv2JpYDzC3cXIySEhYCKxrOcuO4QtJnHh3nq2LkYuDiGBpYwS a7d2s0M4TxklPmxZwwpSJSzgLLHh6CVmEFtEwEvi2eXTTBBFbYwSpw9PAmtnFnjDKHFr3hew KjYBY4nNy5ewgdi8AloSFz9eYQGxWQRUJd4/WwE2VVQgQuJwZxc7RI2gxI/J98BqOIHqv7+f z9jFyAE0VE/i/kUtkDCzgLzE5jVvmScwCsxC0jELoWoWkqoFjMyrGEVTS5MLipPScw31ihNz i0vz0vWS83M3MUJi58sOxsXHrA4xCnAwKvHwcrw+EibEmlhWXJl7iFGCg1lJhPeb+9EwId6U xMqq1KL8+KLSnNTiQ4zSHCxK4rxzd70PERJITyxJzU5NLUgtgskycXBKNTBOOyj6wf3WEx7V YMnL8/JXqYnxq366KuXV6fl1VjPjoyt+syeztm5W/PZj2yqWuM2Tlsr7vFmt4LrA81yw9AGx pQdtt6VqRZWdeB8eJfd6brjIM0upJdFx97wEN2a18y87G7nSu7yt4+C7Ex9NAzZEnjEM++t6 x/BjzOy5snVF907cTtNknf9aiaU4I9FQi7moOBEAYhCyWpkCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.02.2016 17:46, Valentin Rothberg wrote: > > > Hi Krzysztof, > > On 2/18/16 9:13 AM, Krzysztof Kozlowski wrote: >> On 18.02.2016 17:06, Valentin Rothberg wrote: >>> From: kbuild test robot >>> >>> Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") >>> threaded IRQs without a primary handler need to be requested with >>> IRQF_ONESHOT, otherwise the request will fail. >>> >>> So pass the IRQF_ONESHOT flag in this case. >>> >>> Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci >>> >>> CC: Laxman Dewangan >>> Signed-off-by: Fengguang Wu >>> Signed-off-by: Valentin Rothberg >>> --- >>> drivers/rtc/rtc-max77686.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >> >> Nack, because: >> 1. AFAIR this is a false positive. > > Looking at kernel/irq/manage.c +1250 such requests will be rejected > unconditionally when the primary handler is NULL, except when the chip > is marked to be oneshot safe. > > Is there another semantic that I am not aware of? In case the script > produces false positives, I will change it immediately. The handler is "irq_nested_primary_handler". >> 2. Was it tested? Was it reproduced? Was the bug actually spotted or >> just coccicheck pointed this and you assumed that "request will fail"? >> >> Coccicheck is a great tool... but not necessarily for pointing run-time >> bugs. > > I did not test it. To me the issue rather seems seems like something > where Coccinelle is really good at, static analysis. Yet, this is somehow subtle (device inter-dependencies) so it falls out of static into runtime (I mean runtime analysis is needed). Best regards, Krzysztof