From patchwork Fri Jul 5 10:25:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Tk9NVVJBIEpVTklDSEko6YeO5p2RIOa3s+S4gCk=?= X-Patchwork-Id: 13724913 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010055.outbound.protection.outlook.com [52.101.229.55]) (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 5107014831D; Fri, 5 Jul 2024 10:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720175126; cv=fail; b=imQAQ06bubklLZRubJRSOga8py4/BIkhcXXIHcZjvyDVM1JNDt9eb2gmqDTVimxdI/mQxYDPcykmUGOUFqBjvv3g2pSCx7OlpZA8QHpCYSklgeifokv2Y3rJuKfLbvXNeK+oOUX89aXtIfi9ybKVxNmMJiLuXoBrdOPIpe+Pcrg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720175126; c=relaxed/simple; bh=HElkWa+8HWmbFpAUkDQCF+kaAijXM6HdMxW0fcmiByI=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=PnEJltVVBKHWqEWX9hsGAJHda4G7avLnryEnbE+GIb4BKnloHQmuppXFFhoIQ8TO4qKJ8SFkI+gCR1sa23AYMwxiV6kgpliz9L+XqHqBRAuMjEdfpkdjuLtyR2kRSZiwXLnJBifTy65kLiK5KaH5bHMOKtBP/dVNC0S1nxcZYXg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nec.com; spf=pass smtp.mailfrom=nec.com; dkim=pass (2048-bit key) header.d=nec.com header.i=@nec.com header.b=OZ/uKcKw; arc=fail smtp.client-ip=52.101.229.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nec.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nec.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nec.com header.i=@nec.com header.b="OZ/uKcKw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dfwKRSnk/q3ROyaFmYrt9QQr4ytUTUdE8tgf08M/lNlNKe+SleihDx18pXVWUBvSpj3q5e/IoZ45U/UKGwAQiIjT5LAx9URxJ99i9WHmJA4lNvq5IbahhZuZwm6ArxHy60LR2h8sIiQOSNX98SCT0tL8TTfbgP9N1WF0qQBvMh8dgkjPXIOELVRV/EnF0bYew28AwNDOM1N9xF7kxgoKfKHKge/rdi/XE8DwCuW/8UTfCoN6QNZtkjJxZjBWWeAtc/An57qiM/CAZUtglBnrkpJ5iUESbaT+gd5RCg/DE4UV6GaWMPQxT1l9rgvms2KeVzKICklW8LW33N2FS7bBJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MuXf34PFJm/Um2clVlGKPtPU9DTUWMjdONesDuGY6lE=; b=eBLTxRp19N0jgWGhC3nHcLLnfFQBMjuKGfaJtcdDpGythwrAlOjLWzFIQzNIorNmye/kdU3CuMEVuBasKwXsYldorHqVrGURy6KmWHDCrSFtscfNHY0woKFYbUbgHk8IqkNe4V4qxAPDCsRF801o+mC4E7CC07t7D/hpAF6l3wUQk/TUiSOlQ4jvqCPMnFy7KsCWIB3QE0rbNhf0g3qhx7IgauWN3WmJpQ0iXgI7b4v9b2Tf3dTF6D5duRWnmkbh22mX1eOuVd9VPQP03iKgmTvR2Y+BqiG2+tLEPI5XTM6a3HVA4G3nckDUzsptmI0Wg4oWEdangFEUG/lLldnbPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nec.com; dmarc=pass action=none header.from=nec.com; dkim=pass header.d=nec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nec.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MuXf34PFJm/Um2clVlGKPtPU9DTUWMjdONesDuGY6lE=; b=OZ/uKcKwnsj0nf0aOTVugT2poDg9Vnql4snFFhMKdKiQUHXa6+8bS+KKZHWt/uBIVBVPSx+23K7L67/5DWPByemDB7vaNHz6m2mRakFSvMi4fYJmbe68GmWgtXp3wAE5kDUGqvkyNS2g1eCNa1IsWHxNjBKBUpyQ+eug/dCfR7C+k+vfKigScAEI0mLEKjeiN7boTNa/6fuxOvCjY4T1548Lh3lkPrbFjUhWh9K/GxHDIrBSzQhhseTu13Uv0l0BO3AnrsGPzKT2mj9nkyfEL2+1JvPoD2gp2U7UHA3OyADyrFYc1MFcnR66RL6V25IqU9tgE3Bxbtv3iEagvBnk6A== Received: from TYCPR01MB8389.jpnprd01.prod.outlook.com (2603:1096:400:15f::5) by TYWPR01MB10806.jpnprd01.prod.outlook.com (2603:1096:400:2a6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Fri, 5 Jul 2024 10:25:20 +0000 Received: from TYCPR01MB8389.jpnprd01.prod.outlook.com ([fe80::29dd:6d4f:b2de:f254]) by TYCPR01MB8389.jpnprd01.prod.outlook.com ([fe80::29dd:6d4f:b2de:f254%6]) with mapi id 15.20.7741.029; Fri, 5 Jul 2024 10:25:20 +0000 From: =?iso-2022-jp?b?Tk9NVVJBIEpVTklDSEkoGyRCTG5CPCEhPV8wbBsoQik=?= To: "linux-acpi@vger.kernel.org" CC: "rafael@kernel.org" , "lenb@kernel.org" , "james.morse@arm.com" , "bp@alien8.de" , "linux-kernel@vger.kernel.org" , =?iso-2022-jp?b?Tk9NVVJBIEpVTklDSEkoGyRCTG5CPCEhPV8wbBsoQik=?= Subject: ACPI: APEI: ERST: Don't retry read when "Record Store Empty" Thread-Topic: ACPI: APEI: ERST: Don't retry read when "Record Store Empty" Thread-Index: AQHazsWjaDTSYuFPoEWjsVW52y1RuQ== Date: Fri, 5 Jul 2024 10:25:20 +0000 Message-ID: <20240705102517.79689-1-junichi.nomura@nec.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.45.0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nec.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYCPR01MB8389:EE_|TYWPR01MB10806:EE_ x-ms-office365-filtering-correlation-id: cbaa7bbf-aa7f-41ee-bf23-08dc9cdcc5e2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?iso-2022-jp?b?TmZqRFQzeGMvZWNYajFoR05u?= =?iso-2022-jp?b?NWZRMGFtQnBtZFBPaTVQWERtTFdaVUM3V1RQOEpXMEk2WFU1eUpiMlVP?= =?iso-2022-jp?b?REh4OXNCYmNvM3NxVndjWlMvQ25ydUZZTkRYMVZ5MEFKS3BzQndmNGZr?= =?iso-2022-jp?b?aHlnMzZId2lwYldialowQWZ5QlRFQUkvOEw3ODVSK2JuWis5WXJWR2Q4?= =?iso-2022-jp?b?Z05pUWZPM3lxQ1BrMEh0WGdCeWJTK1ZaWk5VMUJLRTlxdXBGVGFQNEhD?= =?iso-2022-jp?b?ZXpZU0M0K1Q3MzlJRTJXZlZoei9HaW02endUUmZSYmhWLzBlVlhsM1V2?= =?iso-2022-jp?b?aGJhQ2lmcDJzbjZQWFhHenlldHEyTj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389.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?b?NHVWRjIvK1FaU0xxK3dC?= =?iso-2022-jp?b?a1NHLzN4MjgybFEvbzRrdndPSFJmc3dpdlFXYXJxS3YrRlU1R1JiYklo?= =?iso-2022-jp?b?anB4WEFwNDFTR1phem1sc0c2cGw4TGlsMHAzbzVrZ0R5a2xIKzVncnZB?= =?iso-2022-jp?b?VEhMbTdiYWQ2Nk9BRjBLckRMSzl2b3hKWnVMbVVTWW9QY0lCQjJXdWdQ?= =?iso-2022-jp?b?cmRZK3czNzh1QmRvVyszZ29JS09PV1ZPb3d1Vm1pQTUvNmZ5SE14WkdU?= =?iso-2022-jp?b?M2tSTDBFcFA3ZEFXOGRSNWtuKzczWTVCdXJmMWhQOHViMDhYUElGR3hH?= =?iso-2022-jp?b?ZCtCY21EZnZhS0QzVWxkNDV1d3BaRlJRZnBCcTViUUd4SHQ2NnRyNFVN?= =?iso-2022-jp?b?ZlNoUHRMeXliL2tYbE9hdkxvdXdiSGk1dGhpTC92NlZtdW9QOGhMUm4v?= =?iso-2022-jp?b?dUdmK1kzMzBlU3V2VDJQQ2Q2TmNEb25aYlhxVldtTHdqN1E1ZzZHemNO?= =?iso-2022-jp?b?K0lqV05yTElVK05rUzdQS3ZKK3hRa3NBV25jeUlpcXZjaGRDeERBcmRa?= =?iso-2022-jp?b?bThvMFBSUXA5WFlIbzhVTG9kQW03QnhqSHdmQWlWTEhES3prRjZFUWcz?= =?iso-2022-jp?b?b2pKUWV4RU5wMVZ3cW5TU1Z1d3FLa0s5Nkt5eUNabStERDRjYzA0ditW?= =?iso-2022-jp?b?ZFNUM09jQW1PM0QzK3E2QVVrNXJ6V21EQjlORUJSSWYxUVNGdkhPamNJ?= =?iso-2022-jp?b?b3E5S0E3RVE2eWF1dHVH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Tm1keHZDdFd2WWc3aUZvek9FM0Q5M3BOdjQ5bHA4YTZw?= =?iso-2022-jp?b?Rzd1NkFHMm9nYVRHdk1jNGMvWGZXcDBDTzB3TWpXSmFoYm1qcVQzbkJH?= =?iso-2022-jp?b?R083cVFwZFZLZ2llWi8zV2NRTGNJYUU2bmlEaGVxYlhySFM1YWxveERk?= =?iso-2022-jp?b?YjZ3Kzc4QkczTml5a3E2YWtOSnNqMERiZGtDVVlzc1R0YW1VMFVUN3VR?= =?iso-2022-jp?b?bmZhWE9vYm03WHpwMjZIMk5jVEtsYzNoMzNzNWEyR0FCWEx3RlJCVlhx?= =?iso-2022-jp?b?NGtmSTVxcWg3cXpxbkNGdEVpT1F4Z05PeUZwWERKbmJKKzMydjJROURV?= =?iso-2022-jp?b?RFF4Y3dUREZqQk9jNHdhNm5aUE1paGhEVGYyK3FlYWJUZ21KZHgrSzFP?= =?iso-2022-jp?b?Zks1RkxBUWlOckRBTUFFaWdNbjRMN0JkSE9Kb2tEOWMvanQ1RU1mNllY?= =?iso-2022-jp?b?Ui9nRk1rYm1nS0duNk9sUlV0OWtTZkFpNXFYM0gyeWlBb2wwajQxZWlh?= =?iso-2022-jp?b?eEtydSsyRFhRNjd6M0x1cllRZnF1Q1lZcUIzZk40K25sSVVHRHRUaGpF?= =?iso-2022-jp?b?SGp1Nnh5d1FLNmVDRGo3Z3YzR1NzYldQMjBzNWpHNFp6dzFHRVlYdm0x?= =?iso-2022-jp?b?MEh5T3hzRGNxZlE9PQ==?= Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: nec.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB8389.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbaa7bbf-aa7f-41ee-bf23-08dc9cdcc5e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2024 10:25:20.6055 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e67df547-9d0d-4f4d-9161-51c6ed1f7d11 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: R7Ds/VbqW6ao5Uy4V4BUQ9QRFnwvJoN5dvxwXYOwATE/1TEMwOQ4dsD57HjAKj1wmP5mAFvPDI9wE00ZoN6Pqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10806 "ERST: [Firmware Warn]: too many record IDs!" is logged on some platforms when there is no record. That happens because erst_reader() retries read when erst_get_record_id_next() returns valid ID and erst_read_record() fails with -ENOENT. On those platforms, ACPI_ERST_GET_RECORD_ID returns ID 0x0 even if record store is empty. Reading record ID 0x0 on empty store fails with status code 0x4 (Record Store Empty). However, both "Record Store Empty" and "Record Not Found" are translated to -ENOENT, the reader cannot distinguish between them and tries to read the next id, which is again 0x0, and repeat that until it fills up the record cache with invalid entries. While such firmware might be buggy, we could make the reading loop more robust by returning different error codes for "Record Not Found" and "Record Store Empty". Signed-off-by: Jun'ichi Nomura diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index bf65e3461531..ce186f8d7a15 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -95,6 +95,7 @@ static inline int erst_errno(int command_status) case ERST_STATUS_NOT_ENOUGH_SPACE: return -ENOSPC; case ERST_STATUS_RECORD_STORE_EMPTY: + return -ENODATA; case ERST_STATUS_RECORD_NOT_FOUND: return -ENOENT; default: