From patchwork Mon Jan 28 17:54:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 10784333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3F55922 for ; Mon, 28 Jan 2019 18:20:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3AD82BA35 for ; Mon, 28 Jan 2019 18:20:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 953A12BA5B; Mon, 28 Jan 2019 18:20:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 342342BA21 for ; Mon, 28 Jan 2019 18:20:29 +0000 (UTC) Received: from localhost ([127.0.0.1]:36498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBW6-00022k-95 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Jan 2019 13:20:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBEI-0003b9-SP for qemu-devel@nongnu.org; Mon, 28 Jan 2019 13:01:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goB7r-0005Vv-E9 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 12:55:16 -0500 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]:44816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goB7r-0005Ud-8A for qemu-devel@nongnu.org; Mon, 28 Jan 2019 12:55:15 -0500 Received: by mail-io1-xd29.google.com with SMTP id r200so14205829iod.11 for ; Mon, 28 Jan 2019 09:55:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qhVyeKwtwNjOzVzPBWHUZn9H9/gTdVFMQPauG5sSUkY=; b=aLHajjXgzHY8n6jzV6LwBIn7/IZ1fuSl9BmgU7+35xUjJ39hGAUBrQqgQYPFJbwwLz 3/NI1X75SahbUnwTfbSJWRlZrJaLWbbUMD2FcBPtaXOkfbVe5lbaX4MAJsrjmgIu1ArI NN/LRxoYdkvVA2LmkvgU4nTQoAhboxa0o47cKYhOpjfEk3ud97yx62WysKSv1yNzcffP 2M1BEqWB9ZHC/lAqyji/2MHv3Kws5B6CxIWlKW+UqgoW7opEc6qyWzpaJZX1LuorXI5t YfmK/UQK4W/51UpOd9rWk/TE0stieDoz/PIQoZzoRHJBmNI69RkQAnQyrUNaqFhhc8K9 3kMw== 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 :mime-version:content-transfer-encoding; bh=qhVyeKwtwNjOzVzPBWHUZn9H9/gTdVFMQPauG5sSUkY=; b=fOYhMFBbVz9wKroUMyg7U47XVqV/NLJEyaIHtnH/sAzzs60nwRuBnfrXR5IfEW+z6I JN/BFNhRpuFuGYHl/pJa6oBprPUWvfbDMQreu+XgBFQzwYeduROzI//rDx2Mq7POcCG2 2cYSgx/j2ire7s+P8UO5CpPKwhdEAsQjJkM8SPub5/OWKWvCFOQFMAarqOPELgBndnpC isAXqSLOsz4tMm4SMfoT74fAnopFf5bV4htTCJWwRj5OJbeL/HVux/qwSNXQUxMuDajV 860/GddGghwXWcX/80Lb1UWi6GnlaqTyIdSSNvENOl3Z0de+HtARfot1YUD+NgeyZ8nl jOxQ== X-Gm-Message-State: AHQUAuagjlbRRY4UWYAqpR5jdwNtpjOvGP4xwvN+oS1BHh5xhpduw+es cYkXlWDtQbXB68j0a8k1Fw== X-Google-Smtp-Source: AHgI3IYQvnagANc2xdZawqyR78r8XSuC6ZXKfrIO6jktnofYLTBZqu/ENHqzcnd0069nJP+83C7REQ== X-Received: by 2002:a6b:c8c9:: with SMTP id y192mr12601752iof.183.1548698113074; Mon, 28 Jan 2019 09:55:13 -0800 (PST) Received: from serve.minyard.net ([47.184.128.64]) by smtp.gmail.com with ESMTPSA id n25sm14257724ioo.78.2019.01.28.09.55.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 09:55:12 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id CD071B5D; Mon, 28 Jan 2019 11:55:10 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id B7582301156; Mon, 28 Jan 2019 11:55:05 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org, "Dr . David Alan Gilbert" Date: Mon, 28 Jan 2019 11:54:39 -0600 Message-Id: <20190128175458.27255-1-minyard@acm.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d29 Subject: [Qemu-devel] [PATCH v4 00/19] Fix/add vmstate handling in some I2C code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini , Corey Minyard , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP I've forced some time open to work on this, it's been too long. Changes since v3: Change I2C to "I2C and SMBus" in the MAINTAINERS file. Added a comment to the smbus_eeprom reset to make the reasoning for the choice clear. Fix a logic error introduced in "i2c: Don't check return value from i2c_recv()". Fix a debug problem in "i2c: Simplify and correct the SMBus state machine", a removed variable was still being used in a debug statement. Split up "i2c: Simplify and correct the SMBus state machine" into smaller logical chunks. Updated "boards.h: Ignore migration for SMBus devices on older machines" to ignore migration for 4.0 and earlier. No other comments received on "i2c:smbus_eeprom: Add vmstate handling to the smbus eeprom", not sure what to make of that. I think that Dave's response to my question was that it could be modified to support different sizes in the future without issue. Dropped "hw/i2c/smbus_eeprom: Create at most SMBUS_EEPROM_MAX EEPROMs on a SMBus and instead added a patch to assert if the number of eeproms is > 8. Changes since v2: Added proper license headers for the newly created files. Removed unneeded code in several places pointed out by Peter Maydell since i2c_recv() returns a uint8_t instead of an int. These are in two separate patches. Added a patch from Philippe Mathieu-Daudé to replace a magic number with a constant in the smbus_eeprom code and verify the count so there is no overflow. Updated the pm_smbus migration to not update the version numbers in the existing vmstate structures. The needed field didn't accomplish what was needed because it is only called on the save side, not the load side of the migration. So I'm using VMSTATE_STRUCT_TEST() to transfer the pm_smbus data now, that should be all that is required for backwards compatibility, and will be safer for falling back to an older version. I found the problem with the SMBus being broken on piix4 after a migration, but I sent it out as a separate patch since it has nothing to do with this series, and should probably go into the current release being worked on.