From nobody Wed Feb 11 01:00:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1623860096; cv=none; d=zohomail.com; s=zohoarc; b=QrB0VRqLCNL45uHjZ0eFbMkSaYnop7YWegnPRrgl6A0Qt8a/VaatilL77ZUAt037IL7jrXEyNU66KbF9Ozn55cjUGMGHl3mFrn6EunoZUkBCN6pVhf3Qotn/89PiNhVZdhR6ReDSLmu7skFF/SAiYVkzo6cEOW4n8hDYjwy0DhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623860096; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xiYohDNx8TlWsyn3BtTL6DGqTBwgAW/ROdRkO4E8HY4=; b=ULap79TOxSq+8ifaTzRtZhZwfMejOeF9Z6wQ+fEDLtOz3/kUr5KR5WGg/4d/ybMP0Wmm0xpJUr2y18ceqMKRgUCUTah7+DTHadgOvlvAPVpmbiGaNRtgkKFHLCeNr2XlUwqxELR6xfR7ONE0uZtku5kQvwuUL8lsBQRcGrW/b3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1623860096074722.2857953665657; Wed, 16 Jun 2021 09:14:56 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id i94so3321384wri.4 for ; Wed, 16 Jun 2021 09:14:55 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id l9sm2272104wme.21.2021.06.16.09.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 09:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xiYohDNx8TlWsyn3BtTL6DGqTBwgAW/ROdRkO4E8HY4=; b=aOtuR9WIqaAD8EuWlMHLswsX7qgNibUGV9gDa9D+IJqM1HBSjtFGI0DQ40mWrk540y kKZZtEDPCaa0vPBcO0Yi1z6vaD86iKshbzdgvVU8b3U1sembRN7RIvFLW5uDpgf1y0rX csbghzGiUxhsmrMoEG8XV9alJ52ZsfOTHwbvM+Bm2sl5gx7Zke71qnGkHAp9AbBLEnvy NWydfgUEoTUkf64bpMXVbO28lxqOKfSsI3i/76BIvdmRjBTaHOUmFALwDjeJAPFV/DhT Qor5ZnHnguxIFG6sFp32DKCcsAfWdyEjIdTyoPgzTMvAe+S2Oxhvd3DeNujG3xOwJCh8 18tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xiYohDNx8TlWsyn3BtTL6DGqTBwgAW/ROdRkO4E8HY4=; b=LnxpBVwWQaImMMtAsRDYVdPVmVJNEsozdU9z/QPGLFmpeTopilVyis8XdnqTeK1W06 naC47Agf6Rc4IP00xnz3OzcEEuAJBFdIx4AsLy0Vl6FKHxoJOtCMRJ7NqHs3dlknl9Hk 32qLK2AZK9nZ+pcxUB/vKGZV6Z4s+Q/0Jb8SBcABDDyhonbb12VwNw0AAiEt6cCiqoU5 cXxWhKZkfugzhfuLX+3dKJNFNYOsoe/g6bg6F4bMJus0yo8kOpuAh7NNC4HRxB7Hu7XM t1O9DwiZH8FLc0DzjcZVLsA7GNTP1M3LfBiMC+hYYxkQrjF4XooZHKM72YseFGgWSwvF Jjaw== X-Gm-Message-State: AOAM532xcw1FTdhiJVO42EIh01aYkC0k+yn1nlT9cYrdp38szsrbkXVZ ycXYwJIV4rRvgnE1SrXEFM8= X-Google-Smtp-Source: ABdhPJwsN8eCQQYbkr0ajVMEPzlbrIOgk7Krr7lKeEptpHIOA991IlVLwNt6A1ghbcCME0vA5P6RxA== X-Received: by 2002:a5d:6747:: with SMTP id l7mr242368wrw.220.1623860094387; Wed, 16 Jun 2021 09:14:54 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Corey Minyard , qemu-ppc@nongnu.org, "Signed-off-by : Frederic Konrad" , BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 07/13] hw/misc/auxbus: Fix MOT/classic I2C mode Date: Wed, 16 Jun 2021 18:14:12 +0200 Message-Id: <20210616161418.2514095-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616161418.2514095-1-f4bug@amsat.org> References: <20210616161418.2514095-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Since its introduction in commit 6fc7f77fd2 i2c_start_transfer() uses incorrectly the direction of the transfer (the last argument is called 'is_recv'). Fix by inverting the argument, we now have is_recv =3D !is_write. Fixes: 6fc7f77fd2 ("introduce aux-bus") Reported-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/misc/auxbus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c index 6c099ae2a2d..148b070ce4a 100644 --- a/hw/misc/auxbus.c +++ b/hw/misc/auxbus.c @@ -139,7 +139,7 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd, uint3= 2_t address, i2c_end_transfer(i2c_bus); } =20 - if (i2c_start_transfer(i2c_bus, address, is_write)) { + if (i2c_start_transfer(i2c_bus, address, !is_write)) { ret =3D AUX_I2C_NACK; break; } @@ -170,7 +170,7 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd, uint3= 2_t address, /* * No transactions started.. */ - if (i2c_start_transfer(i2c_bus, address, is_write)) { + if (i2c_start_transfer(i2c_bus, address, !is_write)) { break; } } else if ((address !=3D bus->last_i2c_address) || @@ -179,7 +179,7 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd, uint3= 2_t address, * Transaction started but we need to restart.. */ i2c_end_transfer(i2c_bus); - if (i2c_start_transfer(i2c_bus, address, is_write)) { + if (i2c_start_transfer(i2c_bus, address, !is_write)) { break; } } --=20 2.31.1