Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp665309rwo; Fri, 21 Jul 2023 19:59:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/R/oNj3GK4BfA+nfgunShB9In3JXpBVMwGRlS/wxrhdQ86ZfDwvi1aroAeZahosQcfMDJ X-Received: by 2002:a17:90a:77cc:b0:25b:ea12:a2f5 with SMTP id e12-20020a17090a77cc00b0025bea12a2f5mr2931925pjs.35.1689994759362; Fri, 21 Jul 2023 19:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689994759; cv=none; d=google.com; s=arc-20160816; b=LSdehYWGkExvHY9iFxHZxs6t5+YOvgGqrldkpS3Y1GT3DEMyolqiaJvKPZk9dH2wIX vtJj4Loi6/crpGIQ8Qa2QMdChuJIdg6EfKs7vHU1a0TU3srIcICRgMdoyJKcgKNtnL1l 2lhrhl+6TQ99kx1/7HP42DUsIRw5yRTJ7RucoPSG7IA9Bubo73Z0UFabk1ZlHeRwBmNN wVKxCUClOcuBEEegbunZu8jSSJJ8KyfQ1Oj0qLy12Z3klHuCJsd7MnOTwI672DA+bSRo q4Qt7nbh+QkyNU+s4ZobWyO1wOW+h/xldI65cI1UxQ8yk7B3xhliY1rNNvsjmCkW9YaZ NKSA== 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=+2exLvrOUZ86LZpFVUrLTB+F5Ra9AtGsBdj9dboQgSE=; fh=TgW5rQoBudPRGqCs3h6dX3YEOqKQfmTkqVrNjVeDErA=; b=WNdLTcgwVrUMPf9/ZOwWqD9moX2KYGHXJSQraxKx7/lGTiVSzEv8bhXEOdbQZT5BUU 6faYeg8CMKp5pThfqI1NoM2QLfxnBWU39RheuEQGEwyE1tgbvIrBKvko8FBJQ9TT3ptD xrjqB3wKMcPdA4CRRz0t3p5AbUwWkORQPtwJtiq3c+Ql3cyOSidHf9SCBMW/zazuf6qN xuXlZunogZaDwHlhHZoV8gAn+KmKYBEVyoENOFSo4x18ST+HtQDGfoh3t4Pzn42UULuF pEv+KY6dG251tkSOpXDGLx8ZVCbFDAEBwuDHv0RSN9cB4QxkfOOSlHGXV3pKxzMeJqEb a1YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BKavWMXU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv15-20020a17090ae40f00b00263355e8183si4430171pjb.114.2023.07.21.19.59.07; Fri, 21 Jul 2023 19:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BKavWMXU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjGVCkk (ORCPT + 99 others); Fri, 21 Jul 2023 22:40:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjGVCkj (ORCPT ); Fri, 21 Jul 2023 22:40:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C478810F4 for ; Fri, 21 Jul 2023 19:40:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 61EC560E9D for ; Sat, 22 Jul 2023 02:40:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DB39C433C7; Sat, 22 Jul 2023 02:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689993637; bh=pi3k2BO7luhchIvvbbw+dGYcE2uioGjCAircbju4KXE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BKavWMXUUtaR66aE/rvOVnP0nmMnlRp/UYHfUJfQvCUbSScDKHlWk+Qx+L9gX13JC aHiKaKJYFq+/fWaf9GrRFxAP3PT19chb4vsv8tpVtidN284ZOPj1jOL5YIrGXZL0jd 5wBcQqlG3g1LngnrscCfYV1DDgZEgkJvdBea4g/otG0rqQwPanyBVHh3RQJUHmem+4 dwumA2EnqS4lzM/ik3M0soVVmoZexHJOIHBmAKOHBpKQabORc4lmj8m4rFWOk0QmVL bxftHVGb+6jHxFU1TlIwcwcl9lVJfqoJfvIyPJMGSrQ9ZhmD93V85p8N42p4HOpdLa JX6GFNZMxKDwg== Date: Fri, 21 Jul 2023 19:43:56 -0700 From: Bjorn Andersson To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, peng.fan@nxp.com, quic_nkela@quicinc.com Subject: Re: [PATCH] firmware: arm_scmi: Fix chan_free cleanup on SMC Message-ID: References: <20230719173533.2739319-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230719173533.2739319-1-cristian.marussi@arm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Jul 19, 2023 at 06:35:33PM +0100, Cristian Marussi wrote: > SCMI transport based on SMC can optionally use an additional IRQ to signal > message completion; the associated ISR is currently allocated using devres > but the core SCMI stack, on shutdown, will call .chan_free() well before > any managed cleanup is invoked by devres and, as a consequence, the arrival > of a late reply to an in-flight pending transaction could still trigger the > ISR well after the SCMI core has cleaned up the channels, with unpleasant > results. > > Inhibit further message processing on the IRQ path by explicitly freeing > the IRQ inside .chan_free() callback itself. > > Fixes: dd820ee21d5e ("firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt") > Reported-by: Bjorn Andersson > Signed-off-by: Cristian Marussi > --- Reviewed-by: Bjorn Andersson Regards, Bjorn