From patchwork Fri Mar 17 07:33:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 71116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp199353wrt; Fri, 17 Mar 2023 00:41:08 -0700 (PDT) X-Google-Smtp-Source: AK7set+Sq23Rh8S0fBATTYRkfeovG5DOZr+c9LBsBATssf3OfpHO97B4s0O9+2OAiZCtfHXT/oye X-Received: by 2002:a17:902:7296:b0:1a0:463d:fd09 with SMTP id d22-20020a170902729600b001a0463dfd09mr5939299pll.1.1679038867765; Fri, 17 Mar 2023 00:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679038867; cv=none; d=google.com; s=arc-20160816; b=oFyRgeWSbmkZhPHOcoOtfkWowLV+NwKfASwS5ijsC4WTiRql2U7HvsNYHHbjFHfnNi HrmJnF4iWJ2K+GNwugeGjjhynwp+S0yoo0GPoxyiuRY8b0phF7HZ2H5807fZdACeGbIr V5AG/xVe20X31VoTtQNph9NpmtoRF0itU4/aL+/3y79ZfeTDglMUGhL1dVzgLRJtOwhZ usduivZucUX1WUE5oQAACjOEr2W9fe7W9/sfj1OTQKCoA5CUytvvOfgpdm98l9EyovFc xYbfPZPgeS0+1Xvg3MbN4vaL9SfxDLots347e4vGk8+qpIH+90CA6ARxhO/c/KbMTzWF 9cLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YBVjqCfAaXIHocj/biG1BN/9O47mNxf9p94ncJmBaIk=; b=tPK54DXb8DXs7gqSLFWLSkfpBsqBRUrW7DXiz+cBkkY9QhEwo4deph+jAFANZXoUFg dfvwBAqpPJ5IN2a5JKl/tocSv/9gW+Vqam5gottBiEwJn5fuO7keicFr4+Lo+ux90sur 9JYLqOrwxP003RIcDWn6p1eEm1JyBIfvhxnnO6UTDERAw2AHzdvmXHcyUTTKNEBLB0Gd FbKsDuoxIPNO5p7eNbx8AynZMRFnz7VveaVaTUQDswhD+bMFw9Xi2NPm3vwdRUB8CsKK 78cnaQQKrRHYVUHsCzOVSKQs/MU7Ib7MF2Y0rv8fTBMyN0xK63wBkSI8R+RLr0RWB0pf FSng== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170903230300b0019ad97d72cfsi1797791plh.590.2023.03.17.00.40.54; Fri, 17 Mar 2023 00:41:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjCQHd1 (ORCPT + 99 others); Fri, 17 Mar 2023 03:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjCQHdZ (ORCPT ); Fri, 17 Mar 2023 03:33:25 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F84F2ED7D; Fri, 17 Mar 2023 00:33:22 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0Ve20Ajj_1679038395; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0Ve20Ajj_1679038395) by smtp.aliyun-inc.com; Fri, 17 Mar 2023 15:33:19 +0800 From: Shuai Xue To: tony.luck@intel.com Cc: xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com, benjamin.cheatham@amd.com, bp@alien8.de, dan.j.williams@intel.com, james.morse@arm.com, jaylu102@amd.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, zhuo.song@linux.alibaba.com Subject: [PATCH] ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform Date: Fri, 17 Mar 2023 15:33:10 +0800 Message-Id: <20230317073310.4237-1-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760599859992157544?= X-GMAIL-MSGID: =?utf-8?q?1760599859992157544?= Fix to return -EINVAL in the __einj_error_inject() error handling case instead of -EBUSY, when explicitly indicated by the platform in the status of the completed operation. Signed-off-by: Shuai Xue Reviewed-by: Tony Luck --- drivers/acpi/apei/einj.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index b4373e575660..fa0b4320312e 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -489,9 +489,15 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, if (rc) return rc; val = apei_exec_ctx_get_output(&ctx); - if (val != EINJ_STATUS_SUCCESS) + if (val == EINJ_STATUS_FAIL) return -EBUSY; + else if (val == EINJ_STATUS_INVAL) + return -EINVAL; + /* + * The error is injected into the platform successfully, then it needs + * to trigger the error. + */ rc = apei_exec_run(&ctx, ACPI_EINJ_GET_TRIGGER_TABLE); if (rc) return rc;