From patchwork Fri Jun 14 07:20:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Singh Tomar X-Patchwork-Id: 1947662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Ms9Qxl7L; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W0rKt3KRrz20Pb for ; Fri, 14 Jun 2024 17:21:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Ms9Qxl7L; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4W0rKp66h5z3cWy for ; Fri, 14 Jun 2024 17:21:02 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Ms9Qxl7L; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=abhishek@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4W0rKk0WL4z3cRB for ; Fri, 14 Jun 2024 17:20:57 +1000 (AEST) Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45E6vtoi003721 for ; Fri, 14 Jun 2024 07:20:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=pp1; bh=sHOjfvLaiSvPR3C2VZS4DT1Oz2 xVleoJhVmU9w8N2xA=; b=Ms9Qxl7LM4+KTVTu129UbWT3hJBa+NH3qhRm1c1Hdq Hsw6zb/BUx54M/o4Ac7LufUhbs8L1cEiM0XbK+h75oKL6tXtxpaxHzBN37FFe04M vHeGt0Vv6LfCRWHbvZU8hi8QQl+pWMtU/QZvxZ4uBvpWn34jS2fh2RSZ4gRa2hNC 5hOIynkiuatwZ1UTAMS7OllkOS917QBkr09Mg095x4t8zgPrVx9HQKE0axU/uDmh +486v4E5SA6CqpjoA2wU+xQyME89+SwBzreCplqDm9rPGI5IAK62p3Cp8NKEyYsK YLzpzdHHQvus7ojir20ahtDDGg4+DEYrBo9/5otg81gQ== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yrgmcg40b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Jun 2024 07:20:54 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45E6he7j020045 for ; Fri, 14 Jun 2024 07:20:53 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn34nq6ta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Jun 2024 07:20:53 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45E7Klqw54723038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 07:20:49 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 997C62004F; Fri, 14 Jun 2024 07:20:47 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FEE820040; Fri, 14 Jun 2024 07:20:46 +0000 (GMT) Received: from li-22421c4c-355e-11b2-a85c-fdc6c782cba9.ibm.com.com (unknown [9.171.38.19]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 14 Jun 2024 07:20:46 +0000 (GMT) From: Abhishek Singh Tomar To: skiboot@lists.ozlabs.org Date: Fri, 14 Jun 2024 12:50:13 +0530 Message-ID: <20240614072013.18125-1-abhishek@linux.ibm.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PgWzVySish4Lu2KnhnAvqNVS99odj1tC X-Proofpoint-GUID: PgWzVySish4Lu2KnhnAvqNVS99odj1tC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-13_15,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406140046 Subject: [Skiboot] [PATCH] core/pldm: Fix pdr handle to add first pdr request X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Abhishek Singh Tomar , arbab@linux.ibm.com Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" As per the specification: To retrieve the first PDR record, use the get_pdr_req function with handle 0. On the BMC side, the first PDR is sent in response, along with the next_record_hndl which can be used to access consecutive PDR records. However, it's important to note that the first PDR may not necessarily have a handle of 1. In the current scenario, providing a record_hndl value of 0 to pldm_pdr_add() will always result in the addition of a record to the repository with a PDR handle of 1. In current fix record handle is extracted from pdr record data. Signed-off-by: Abhishek Singh Tomar --- core/pldm/pldm-platform-requests.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/pldm/pldm-platform-requests.c b/core/pldm/pldm-platform-requests.c index cb0ff9443..01eb12925 100644 --- a/core/pldm/pldm-platform-requests.c +++ b/core/pldm/pldm-platform-requests.c @@ -993,6 +993,7 @@ static void get_pdr_req_complete(struct pldm_rx_data *rx, struct pldm_pdrs *pdrs = (struct pldm_pdrs *)data; uint32_t record_hndl = pdrs->record_hndl; struct get_pdr_response response; + struct pldm_pdr_hdr *pdr_hdr; size_t payload_len; int rc, i; @@ -1065,6 +1066,8 @@ static void get_pdr_req_complete(struct pldm_rx_data *rx, if (response.transfer_flag != PLDM_START_AND_END) prlog(PR_ERR, "Transfert GetPDRResp not complete, transfer_flag: %d\n", response.transfer_flag); + pdr_hdr = (struct pldm_pdr_hdr *)response.record_data; + record_hndl = pdr_hdr->record_handle; prlog(PR_DEBUG, "%s - record_hndl: %d, next_record_hndl: %d, resp_cnt: %d\n", __func__, record_hndl,