From patchwork Thu Feb 1 04:52:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Rmxhc2ggTGl1ICjlionngrPlgrMp?= X-Patchwork-Id: 195159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp210735dyc; Wed, 31 Jan 2024 20:53:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIN8akzFC/hl7Rkw4gSVq2QH2Jjkj0zafTPviaWAY4HZ6S1ZeLzIAzMRXaEdi2hJpWwTMy X-Received: by 2002:a2e:9e10:0:b0:2cd:4883:6e25 with SMTP id e16-20020a2e9e10000000b002cd48836e25mr2615459ljk.50.1706763202328; Wed, 31 Jan 2024 20:53:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706763202; cv=pass; d=google.com; s=arc-20160816; b=naiq1hmMTtnFtV2GVFwoZcsIizpO0Z994hs2y6KrIRSiJffMGYiY551Z6xE6JyAkxP oUOLAFwZpqwgm9nJmzz6DP8WQf8iXXwHngQFPvupxSnIrGvYbcVfZZSlEViZFeaIma78 lwqyGpOrTTXaZ59VEyGY4YsQ0USkLMdvT7vFgCMYQXrud/KFv9AmRmn0yCMdQVsjtJLK GPqAhH2CaiQY/fBPIIMqXdJLiXbXqif7dt3d0h2FNkGtm71M09fwhBwqlJJgsgGZEkcs 7bC5Yxso1BDNSf8zV2XFVguVhcJQQDWBsUvR22Zp+XeI0Mihw/SICqSePFv5FrZKqDil ubNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=bLgCShFq1WIC3Xl1kd4l8YHBBYLHXkqdRbA4uvGyyuA=; fh=DjvkD/iiaXG5sihyLKRyLoAJohFSYuFvR+t+YvA/uXg=; b=dlbGAb4t0w9TH40KbB9c02w2sCe6TTOEAWcdgA5KV1VpayaBOKsivGRvpnoNooMbUg 4cVGcpnW3TkV+fqr0DfSQHqkx99hK2ExSu55A87aGxL0IyqhgDBgKlTm+Yf4+oKz5upa mC7iC5vaQUjBAFMJbSPcxK5NA3AdnUMBf8lYMuPrgKx3w1RqXzVzwOEcHjS8RAUHyvni nfEjYIdi+pB0X24d7vO4NAONZxjsASkZ3q30a+JhUzcVywgmKGL+8XaCC9EVTWKuYr52 WDzI4u3CqpU/cSzRhLylVkqunmED23rZEHv4a2ZyC71iOLjw4GxMauCJb91V4Q6hR6zp qhTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="iiOYb/2Z"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-47636-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47636-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com X-Forwarded-Encrypted: i=1; AJvYcCX7wyJ4ZwLPzhenAyZTHCrhuqk6/QFE8asT0Htz+1HRbLW+SytSRp3n96mjYnk2nrlZLVe6zyRRIKRiOSTxyQeCPhyUrQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id er23-20020a056402449700b0055edfc81db2si4633214edb.310.2024.01.31.20.53.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 20:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47636-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="iiOYb/2Z"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-47636-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47636-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E70FF1F27E30 for ; Thu, 1 Feb 2024 04:53:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1517F3C488; Thu, 1 Feb 2024 04:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="iiOYb/2Z" Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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 97F763BB2D for ; Thu, 1 Feb 2024 04:53:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706763184; cv=none; b=ME+Pw+utnEgSbuBkdycnz+IMrx7JoDiEWMeBWj6kxRiFcDsUE+PZOaY/Rf7lDBgkkHleY84ramiS4dXVOmWhwR8fDi7ZWmdv/lY7mSp3oY01Y5tmH2QXXLmLKAtsRH27j8xs7RL6oh/OprM74wrSo6aWEU4G9LPXlWIhgIae/IM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706763184; c=relaxed/simple; bh=6Q4hZB342kOUQre0oOMFijkniStNxdrC30MbCD0CfqA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=g9IE4TLuMakt5wPwsLvwtu0az9oJSgaZ7kxWgWmZigwrDECjB97qReH7fGHk38dy0eg3r2uNpy7uISIajTA1R6AxnpqG2mo8PSJBk2GFb/tVftLlWBLzzC1bqfwMFQzkHUCTLZPAmAC605MlksXQ86vOSeDDpulsM2sMFdEc49Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=iiOYb/2Z; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: c4175196c0bd11ee9e680517dc993faa-20240201 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=bLgCShFq1WIC3Xl1kd4l8YHBBYLHXkqdRbA4uvGyyuA=; b=iiOYb/2ZPevhED8wObTiUgUTIi7YTMZcy0iMRL+9cmWRVOnUoT+GeLzDiPmmaGTf264Gbc2EQ6fuXqDQqq0CZlGfxmYgfIvB7HAN8B0Prktb8NX8HlTTN4AzpQMBUwjXdNMjMHJzhH5GatM2xniyuEWC6tKyg0r4kYbtjh0uZ6M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.36,REQID:e54dd109-452c-46b4-9121-1d364d53bb3c,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6e16cf4,CLOUDID:2f027e83-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: c4175196c0bd11ee9e680517dc993faa-20240201 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 805437301; Thu, 01 Feb 2024 12:52:56 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 1 Feb 2024 12:52:54 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 1 Feb 2024 12:52:54 +0800 From: Pin-Chuan Liu To: Sudeep Holla , Cristian Marussi , Matthias Brugger , AngeloGioacchino Del Regno CC: , , Pin-Chuan Liu , , , Subject: [PATCH] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode Date: Thu, 1 Feb 2024 12:52:50 +0800 Message-ID: <20240201045253.14390-1-flash.liu@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--2.938200-8.000000 X-TMASE-MatchedRID: V0b+0D6KeHB3VjVXh/TSj0+4wmL9kCTxsEf8CpnIYtnz+Z+5iD+iRb87 jWxVKGOh6lVWmieuZwniU0wvQv0w64JrRWPc34Z+A9lly13c/gGy4iyjvVWTon5h6y4KCSJc3oz JRX7b4NnHBJlWHsfjZDhRWiGxovmInVURoFo9SBy5kfgtJfb41X0tCKdnhB589yM15V5aWpj6C0 ePs7A07fhmFHnZFzVqsuEZvQp0J9pIfsylPBBktLaUERHa8u2NERrrPWZ/TB+IKiZao8KaJQeWS 4msO1E5EoIaZ0cyok3N8/wCCOEm3aRHRNjz1UNJSZrfNhP3sgUBh9AgBSEFrJm+YJspVvj2xkvr HlT8euJ0YHKn7N1oOA== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.938200-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 6840BBDB642849DB19F6FAED2D4AB1AD13039BD7662C89BC26B20A7DB8D9EFCA2000:8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789670931624454176 X-GMAIL-MSGID: 1789670931624454176 On txdone_irq mode, tx_tick is done from mbox_chan_txdone. Calling to mbox_client_txdone could get error message and return directly, add a check to avoid this. Signed-off-by: Pin-Chuan Liu Change-Id: Iacbe0d36ef9cc16974c013c3e94c47dc79eae52b --- drivers/firmware/arm_scmi/mailbox.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c index b8d470417e8f..f6fe801c2e34 100644 --- a/drivers/firmware/arm_scmi/mailbox.c +++ b/drivers/firmware/arm_scmi/mailbox.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -275,7 +276,12 @@ static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret, * Unfortunately, we have to kick the mailbox framework after we have * received our message. */ - mbox_client_txdone(smbox->chan, ret); + + /* + * With txdone_irq mode, kick can be done by mbox_chan_txdone. + */ + if (!(smbox->chan->mbox->txdone_irq)) + mbox_client_txdone(smbox->chan, ret); } static void mailbox_fetch_response(struct scmi_chan_info *cinfo,