From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-104.ptr.blmpb.com (sg-1-104.ptr.blmpb.com [118.26.132.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69F993A1C9 for ; Wed, 4 Mar 2026 02:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772591753; cv=none; b=aeS01Cy9LstjzjdHSHUw4rUVOrGVdBzup6nI7IeEwPdszI8BaSKw5Mr8j+TdlDWXMGtMTsQ+sn7UCn4do36+D//tPiEKY5VVW9DbhO6CmPGFY9M5hjiB0b6OSBMePo0ORRVaT6PxlfJ9KeEjaeHpkmPkPF/JpWH0UmCAw4OpJ3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772591753; c=relaxed/simple; bh=X6O74kQDAnIsA39kE2y5vdtBX+ZCHd28uJdY6B5sA7U=; h=From:In-Reply-To:Cc:Subject:To:Date:Content-Type:Message-Id: Mime-Version:References; b=Mm8KlnuMly+Ymg6ED/x4onnG1OiyzYxMTM4kCiHKGD0ch6d2b6f7O7vzaFDeuR5JL8ubP7Acr1eBXQ1OQdryBczV5WYSxkDPFT/ltQpYVwT0sxhwGz0+TM4Iqsq/gE+gDrSlAcHycbdum8D0vOCEjRm3kUIQkyWw4Utj7egrJkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=L1vYTNlf; arc=none smtp.client-ip=118.26.132.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="L1vYTNlf" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1772591738; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=2QRBYwYeKGYOX0A+C3w0+/dKAh7UOTvzYv4Spo6o19s=; b=L1vYTNlfY3emjteuz+E5c2IGz8Mk3aYlMK25aaN2U8DYKlm0OjxTBV6YK8RjKmG6yW5MrO mdB9AzupK5hz1s5Uuo0fc77kA/TqukRV7a8DqP/G2HigqKg0aY5neu8Dw56euROaRkgQRO LenGXcaWjavGO45dmrX19Se3a9ZfkPet5uCy1J4rdBCwRwx+lZYUjrWjKFRM57NsRKUSF7 EqVCUsPCpf/lVAMefRdkeQTo2FUgrCpsJb80flb/AC3QceKr2kcXNHija8yBd4uFqTIIeQ uS06ar58czLlXv8gn+ovmLwljDl6Txw9aKI+mH8pCmjTCZFrzKiFR7Y7Cnh3tg== From: "ByteDance" In-Reply-To: X-Mailer: Apple Mail (2.3776.700.51.11.4) Cc: , Subject: Re: [RFC] ipmi: ipmi_ssif: require minimum response length To: Date: Wed, 4 Mar 2026 10:35:09 +0800 X-Original-From: ByteDance X-Lms-Return-Path: Content-Type: text/plain; charset=UTF-8 Message-Id: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260302061746.1579192-1-zhangjian.3032@bytedance.com> Content-Transfer-Encoding: quoted-printable Thanks for the review! I=E2=80=99ll send the v2 patch. Jian. > 2026=E5=B9=B43=E6=9C=883=E6=97=A5 21:50=EF=BC=8CCorey Minyard =E5=86=99=E9=81=93=EF=BC=9A >=20 > On Mon, Mar 02, 2026 at 02:17:46PM +0800, Jian Zhang wrote: >> A valid IPMI over SSIF response must contain at least three bytes >> (NetFn/LUN, Command and Completion Code). >>=20 >> Some DMA-only I2C controllers may return short reads instead of a >> proper NACK when the response is not ready. Treat such short reads >> as incomplete and retry until a full response is received. >=20 > Well that's unfriendly of them. >=20 > Anyway, I see the issue. I would ask a couple of things: >=20 > Can you add a comment before this "if" statement so people in the future > know why it's this way? Otherwise it's a bit mysterious. >=20 > Wouldn't the i2c_smbus_read_block_data() in ipmi_ssif_thread() have the > same issue? We should fix all of these if so. >=20 > Thanks, >=20 > -corey >=20 >>=20 >> Signed-off-by: Jian Zhang >> --- >> drivers/char/ipmi/ipmi_ssif.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif= .c >> index 37a5cb5c53f1..64ee939a7a4b 100644 >> --- a/drivers/char/ipmi/ipmi_ssif.c >> +++ b/drivers/char/ipmi/ipmi_ssif.c >> @@ -1300,7 +1300,7 @@ static int read_response(struct i2c_client *client= , unsigned char *resp) >> while (retry_cnt > 0) { >> ret =3D i2c_smbus_read_block_data(client, SSIF_IPMI_RESPONSE, >> resp); >> - if (ret > 0) >> + if (ret >=3D 3) >> break; >> msleep(SSIF_MSG_MSEC); >> retry_cnt--; >> --=20 >> 2.20.1