From patchwork Thu Feb 1 09:57:52 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: 195235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp40059dyb; Thu, 1 Feb 2024 01:59:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGS/nfg5+BEhv0/O+KcPFeG+qdFC+ZF30+MmhG6O+LbGtAd/l5gsynwx4TTV83+t5bsfczD X-Received: by 2002:a05:6214:2589:b0:685:b03f:113b with SMTP id fq9-20020a056214258900b00685b03f113bmr5574658qvb.38.1706781571161; Thu, 01 Feb 2024 01:59:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706781571; cv=pass; d=google.com; s=arc-20160816; b=CMjwKDrERpU+l/mjkCLWO2vXN3b5O7EdhXRpkdNWhezQhJpWP7mZZmSmfq2bgQmU1J zjMXrHimhXuhL3FAJe4TddVbXrXcD/W8gwH++gSlAbvg7e+qiSGJuiFxjb7IiwrHPxyR 6ACcHBWOlYcx2F0OTpp04NG3w4op69/4ouu1OjOWG+JQKaCgPNn9xw9nGigMMp4RJb+i 8pVYBDgQoQoyXxW/RvBQgqBF3GDifBqaauEdS7ubfCXYdeOCsPlEGxOmCrMgivwHB6IO 94CTazZp78VDoaQRPv6pNKGj7J+ZmC4WBHlv7QkHfVnxcXcpb2v3dJXVMj2gy5fMzU4u XGeQ== 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=IV7dhqul9WvXyKJ2ZoYl348suTPEjJTKUrzYhGujRks=; fh=djg+Y3WwuSShQOGQ+cMkuYmTM7j2joVUQ0WlU7REBOQ=; b=gmKwYHC3IVFupM95saUr0gF9IR5/GmR2eoILwJFJf9EysA2MzPcJP1JwjxkG2hHjqr ynVNUF+jMcTp+fjfub3JrBClJ1w7MbDxNbFQYSoVxGsvtpzd/gKD2SeO/hZ5ZMwAe6wr 5XW6AoEMjlUePkbVsiDesWMhvqvPwkC/OSdcr/2pUs23MN6bOfuMl8wZFBc1d4a4cc+3 L/cSMwmeZ9SJ4hgnEIifxbd+79886r+Axl4gBiU2CYA+5i9zahJWAkS7THCwE+rXamuL hbcAHDO0eAg+KUm4f6hgN8KbGRBxIjSKuL6Fv7fndOp6qIKZHxshcuh/Pl+yuobfhZas rtEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=YCiSTW1Y; 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-47920-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47920-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com X-Forwarded-Encrypted: i=1; AJvYcCWNtDZrluwswdunJlXT3TwwSIOnINkAms/o0/WHHERajz7fKb3a3QvzGl3zuyJb799JacykcZpszuEj/pVY8j+0INEFYw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iu5-20020ad45cc5000000b0068c405e6bc6si11664190qvb.271.2024.02.01.01.59.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:59:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47920-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=YCiSTW1Y; 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-47920-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47920-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D8DBC1C28BC8 for ; Thu, 1 Feb 2024 09:59:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B19815B0F6; Thu, 1 Feb 2024 09:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="YCiSTW1Y" 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 AF41B15A498 for ; Thu, 1 Feb 2024 09:59:08 +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=1706781552; cv=none; b=dl6azFOFVIGFBg85aYo2Ye6msMJH1tQ97xCeqTuqBr6dBPco3a7+uk5lsnRxI5hVzjRXZFM7KIuaR81yJOYP9A4Z7tCfRgLLTKQkv3WFMF1YZXik7AtUBhnBhbDgrUZBmSu7at8ytPZLA+R+UX+JCjmfie6ru6GLupn4jmV5DOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706781552; c=relaxed/simple; bh=0Py4q+pTOmqEv1tbTXSx6iTRN0wAURlDATZNMO9qr/Y=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=LUTtHTDsb+sroNKz6PCoQwXpVLWxFeUSFgAgLddpsOSRutNk2rKnvKfyg8S7F4bYiE9C6UoxkgwouE8LnzlR5nuN0o9OoAqhThzOcKn7Rfpdl5GxiFBWWZwYyZO8dWPeZ50uryWpMrFzAKHpRqnE+Cghpn+6yTRn19JIk2CCUPE= 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=YCiSTW1Y; 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: 853e8c8ec0e811ee9e680517dc993faa-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=IV7dhqul9WvXyKJ2ZoYl348suTPEjJTKUrzYhGujRks=; b=YCiSTW1YR5WgUfsccaksI0OH8Bg4smHLY1RBb3EkzQVTX+CrdDB7eyIUsXUCfXwibT2/YyXM/zMMUL5UdsCvOT6xcaN5PpYdNHS/vWGv4jEAWIvy+64lWrBJfUZFRyy9h5+cvo/FBi5V0Y8Wz9KIG11casO10Qwvf1ONKgAgpu4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.36,REQID:a80a9e6f-1e5a-4ff2-8fec-d4d2eef05944,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:f192e88e-e2c0-40b0-a8fe-7c7e47299109,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: 853e8c8ec0e811ee9e680517dc993faa-20240201 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 763909255; Thu, 01 Feb 2024 17:58:59 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) 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 17:58:57 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 1 Feb 2024 17:58:57 +0800 From: Pin-Chuan Liu To: Sudeep Holla , Cristian Marussi , Matthias Brugger , AngeloGioacchino Del Regno CC: , , Pin-Chuan Liu , , , Subject: [PATCH v2] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode Date: Thu, 1 Feb 2024 17:57:52 +0800 Message-ID: <20240201095754.25374-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.422700-8.000000 X-TMASE-MatchedRID: wpfAD6xEq/V3VjVXh/TSj0+4wmL9kCTxsEf8CpnIYtnz+Z+5iD+iRb87 jWxVKGOh6lVWmieuZwnS1Xndr/786uHxFb2pjr4bsyNb+yeIRApCX8V1FiRRkt9RlPzeVuQQost SmZzTxtqmuE8sHNH+0VdTP5dw4GERGN63p9ap1YqTEgTE0DYkgNJ178I1tpklvQmfz7H+YLGjxY yRBa/qJcFwgTvxipFa9xS3mVzWUuCMx6OO8+QGvvp6VplSc3s0tpvpvul44/cJ0fmqU3YzVcLTD yr2YnVuSsYg+5kG385nseWfOBeyocaMMthp5d9Dfe0egsLORU77IUwzFKThe3mVKZusLp922v9O jYWA2uMMswg45VMfPadst5iAforfVlxr1FJij9s= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.422700-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 35B1F35528FCD59015ED3E5BC9AED8B5A4809366F666BAE20EA5A4EB88B2D1CE2000:8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789690192665178448 X-GMAIL-MSGID: 1789690192665178448 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 --- V1 -> V2: - Remove Change-Id - Use single line comment drivers/firmware/arm_scmi/mailbox.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c index b8d470417e8f..d391463e3208 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,10 @@ 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,