From patchwork Mon Nov 6 11:03:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 741339 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1026938wrr; Mon, 6 Nov 2023 03:17:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnO577azcCuv46QYCQVWoU+swsvkpPtxW6k5OpFX8/U/OHxOjkj3sgIxWG1ZISE/efkdQ1 X-Received: by 2002:a05:620a:4d8f:b0:777:6d:b877 with SMTP id uw15-20020a05620a4d8f00b00777006db877mr24456911qkn.68.1699269446395; Mon, 06 Nov 2023 03:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699269446; cv=none; d=google.com; s=arc-20160816; b=GkE6xQ1fRuZvr+srMTlCxuZI/jdnoWCvgPUTmNdC4fr4J85KTCDK4qiABipHl00B3L zohpDTjW48AFj07NVVAV5ZUm9v8teS/Dbv5EnPG7gxYZeXIwxSrryGxqENt6dhDEyWFJ 5WMXBfxRYZO7CweAVn8TMbqYubOB7IhemB2b5civW5f3nFKX73N7swfvic9DE0gpno/l fetMgtydLDeucnhNJjQ3Bm2+OcG3ERsCofAjvjU5no5C6VhRwlVsceSji8IBjOeR4mVO WPTSWIJ1QxMs0zrVs0DEcJsiHj4tm3hxlqis84rOT62sHVQ75ca+fSHGGlVqQHWE9CCG Giiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/UYA9fxIVAJDV/ugwhxZLfTB1YL01/OCPxws1OIhgNw=; fh=/lh2e3kdFR1p/xQRLC4hlj1R95n6elWtlHxD1hYgJ3g=; b=DOrRd4s3Uur0rVEH6jJfeg79lC0na+YR6iltacdyL/ULfiLePuHg8GDqZC6kb4h3E6 aaJkTjXdBC3XMgFlU7dVU7ojPSL3Bw+g5Yresyv2TenmPgfpFZAWYW2pavRmN7/WyNNu 9MYB5IPoyO/acvG4gwMHel7UUszvOdMwmihWv3/1rAP4jHJgpQeoFQZ0qjmJUo8SpW90 nqqR8s3PFMxuENym66RUx9drFKUQgqCig6AKZdNLZnwBOsEGv3JXzesOVhxdeOuwfPwV b76L7rYBze2QUHCxRzgxatStEKMOEnmLf/LiFqoeduzC0rvEQu3p8O1CvhFmSuF55ynF 5vqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twhGE9uH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id br44-20020a05620a462c00b00775d3ebaab5si5454264qkb.286.2023.11.06.03.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 03:17:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twhGE9uH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxUw-000361-Ee; Mon, 06 Nov 2023 06:10:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzxUU-0002Xt-Cd for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:10:03 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxUQ-0005gL-Fy for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:09:58 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40891d38e3fso30646515e9.1 for ; Mon, 06 Nov 2023 03:09:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268993; x=1699873793; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/UYA9fxIVAJDV/ugwhxZLfTB1YL01/OCPxws1OIhgNw=; b=twhGE9uHJIOhRvFOenLm90pUF25nxRVTWx0JYDpC+/N8YiAOkdiwraE6+tgn+rYhOE coOC2fFY2iqRogMJcZhYSjiMCWA8M83HXCY92NV/p3e6nLzUuMAuimPw4xsTJzfVzUBO MOsHlH6/QcMqPwAl1pMCvYeGP+7wEGDLaYQSV7Al6owAtRxM1sRVh55//r0qpJ+7A05F qFs4KrMlq5gWxF7YGTxFlGXcrsLKaMOnPdXRB9LwHrE3ZMpDY3jbo0zugd2r7NzvtmHB 9tmCTjrUai7KJQQZL345MrzfOt6YSrx0BTlP3gbDNBjDtoApEV0qTbKrCBlgQLcapnD1 ZKWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268993; x=1699873793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/UYA9fxIVAJDV/ugwhxZLfTB1YL01/OCPxws1OIhgNw=; b=OKgJCwh0cs9EqGA7IYuNTAteFhAM1mhpxpdcvZPsDrXA/vB5OQi6BUaFPe8xYG+tFt YRAfNYNBi6eLtd+99TZwr3oxCgLlkkt5gMkj1OlKtUKZFBnHKwe69Uv9XSObjK0DE0zX wx2zcGwBYdyexsP7k08nnwm5m18hQ2x/ii0v/YlMWeBQF8mYvlzVLa9BI98O2PmfJdr2 ldqToHMLg/MZMDRIXrm0zk7dC4En7i0ZPX275Y6lIm3vsUDRwAGmcU4tCL1AHCn9ZaYu RIOxKi1O5aGW89tbUcnLZIkRnQujD+4OVnynfYzcyNtgbrmxhSB/zrZOkG28tBuhuT5f 4Hhg== X-Gm-Message-State: AOJu0YzDhy8TtJ67KWFkHCKxdL9481GgEzhxxkXrqOlzkHRkcjEm9sRE Q+qw+KBWN6hS0xzsLU2lSRp6HbcbVxNBH18DhVA= X-Received: by 2002:a05:6000:4021:b0:32d:b991:1a71 with SMTP id cp33-20020a056000402100b0032db9911a71mr27821328wrb.0.1699268992895; Mon, 06 Nov 2023 03:09:52 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id f18-20020a5d58f2000000b0032da4c98ab2sm9102932wrd.35.2023.11.06.03.09.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:09:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Titus Rwantare , Patrick Venture , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 55/60] hw/i2c: pmbus: immediately clear faults on request Date: Mon, 6 Nov 2023 12:03:27 +0100 Message-ID: <20231106110336.358-56-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Titus Rwantare The probing process of the generic pmbus driver generates faults to determine if functions are available. These faults were not always cleared resulting in probe failures. Reviewed-by: Patrick Venture Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-7-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/pmbus_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index 3bce39e84e..481e158380 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -1244,6 +1244,11 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len) pmdev->in_buf = buf; pmdev->code = buf[0]; /* PMBus command code */ + + if (pmdev->code == PMBUS_CLEAR_FAULTS) { + pmbus_clear_faults(pmdev); + } + if (len == 1) { /* Single length writes are command codes only */ return 0; }