From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FFF9C433EF for ; Wed, 29 Jun 2022 08:40:20 +0000 (UTC) Received: from localhost ([::1]:56098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6TFD-0002Ho-1r for qemu-devel@archiver.kernel.org; Wed, 29 Jun 2022 04:40:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6TC4-0007rd-V8 for qemu-devel@nongnu.org; Wed, 29 Jun 2022 04:37:05 -0400 Received: from 2.mo552.mail-out.ovh.net ([178.33.105.233]:46793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6TC1-0007aA-5j for qemu-devel@nongnu.org; Wed, 29 Jun 2022 04:37:03 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.1.10]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 483F027132; Wed, 29 Jun 2022 08:36:58 +0000 (UTC) Received: from kaod.org (37.59.142.106) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 29 Jun 2022 10:36:56 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-106R006b88761a7-3ad0-45f5-b9f7-70fcbcc403c3, 74A1F81DE4F8936248B5873BB0AED4007818FEC6) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <16eb386e-a1c7-071b-12b0-b47e9081c4a3@kaod.org> Date: Wed, 29 Jun 2022 10:36:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2 08/13] hw/i2c/pmbus: Reset out buf after switching pages Content-Language: en-US To: Peter Delevoryas CC: , , , , , , , , References: <20220629033634.3850922-1-pdel@fb.com> <20220629033634.3850922-9-pdel@fb.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20220629033634.3850922-9-pdel@fb.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.106] X-ClientProxiedBy: DAG9EX2.mxp5.local (172.16.2.82) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 7b48de1e-5d51-4211-ab1d-4c28d0582fa5 X-Ovh-Tracer-Id: 1092685862009670578 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrudegledgtdehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeekteejtdelkeejvdevffduhfetteelieefgeefffeugffhfeekheffueefledujeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehpuggvlhesfhgsrdgtohhmpdfovfetjfhoshhtpehmohehhedv Received-SPF: pass client-ip=178.33.105.233; envelope-from=clg@kaod.org; helo=2.mo552.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 6/29/22 05:36, Peter Delevoryas wrote: > When a pmbus device switches pages, it should clears its output buffer so > that the next transaction doesn't emit data from the previous page. > > Fixes: 3746d5c15e70570b ("hw/i2c: add support for PMBus”) > Signed-off-by: Peter Delevoryas > --- Reviewed-by: Cédric Le Goater Thanks, C. > hw/i2c/pmbus_device.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c > index 62885fa6a1..efddc36fd9 100644 > --- a/hw/i2c/pmbus_device.c > +++ b/hw/i2c/pmbus_device.c > @@ -1088,6 +1088,7 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len) > > if (pmdev->code == PMBUS_PAGE) { > pmdev->page = pmbus_receive8(pmdev); > + pmdev->out_buf_len = 0; > return 0; > } >