From nobody Tue Nov 26 16:44:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.vnet.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1706223031; cv=none; d=zohomail.com; s=zohoarc; b=JUoUKAq64H5XqgvBK2nURER+wXKNCoFFh/jjJESk18qj2zRTQliYYaxPKzycqA8Jw8z9w2/25ncOrQGivJOSOn7p0OnewZuiOFqzusknDw8zU3G89xstD4UkvGKLcCkmnKnbjirUXakyczwsfX7jTl9ORE8kwVOaTH59ZAHAeQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706223031; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=maEWMlrdkHct1qP7Yvm98re/GIwc//Mhgqb9LT8d9sE=; b=NGYcofykH21/sS4FNRqn90gHGvDADMgDYCO7I6jMbjfZo6FK0ZADv+QWmrNGhmHxsJFxoi0njLWB63qWmcQVz53ZFd+QsPkTpAl0A2pYpqxxYNctVIRlTlGvKHEM0/Ex4Fqz1XfLs8p2nYYsEVHcEdai9o0Z8oymnR+DGVVpa8Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706223031410126.39790639132514; Thu, 25 Jan 2024 14:50:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT8X9-0007C4-1g; Thu, 25 Jan 2024 17:49:19 -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 1rT8X7-0007AN-1K; Thu, 25 Jan 2024 17:49:17 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rT8X5-0000Ui-79; Thu, 25 Jan 2024 17:49:16 -0500 Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40PMgKil000602; Thu, 25 Jan 2024 22:49:05 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vv0nv04mg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 22:49:04 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 40PMgYFW001179; Thu, 25 Jan 2024 22:49:04 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vv0nv04ku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 22:49:04 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40PMU4r6025636; Thu, 25 Jan 2024 22:49:02 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3vrsgpf4m6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jan 2024 22:49:02 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40PMn1xc21758616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jan 2024 22:49:02 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A980D58058; Thu, 25 Jan 2024 22:49:01 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FE8E58057; Thu, 25 Jan 2024 22:49:01 +0000 (GMT) Received: from mamboa4.aus.stglabs.ibm.com (unknown [9.3.84.87]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 25 Jan 2024 22:49:01 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=maEWMlrdkHct1qP7Yvm98re/GIwc//Mhgqb9LT8d9sE=; b=P59sH3ceg52vmJ+w1GZ8dyCtg1m3oNOEL+ZCvTpC/hxyB0yllZLskOS6zZBgkJdlSRus FmluXu2DUnykXPfiC9hzUSmgvbWif/klw+h098V8JuG/6qi4GkoD+1Px3dCmcwIf9Qf1 bOC6tMyVlRvdpEGOIU653VJdLcPifxpJuFc7qoT8Z2CXCLv36WCmRgcovzz343qJ5TFN v2inIaNLj1QEar2h4slOx49/zVjfQCE95Y9O++Hsdf10ieOcx8hLoSVz2d9tbTncTHm+ nLG/pTMfCgcB/5g5wXQq9cL1r8z1H9qLuqixZDTet68dVjpCe0+61i2pjw6t/kbGXi24 dw== From: Glenn Miles To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Glenn Miles , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Reza Arbab Subject: [PATCH v7 6/9] ppc/pnv: Use resettable interface to reset child I2C buses Date: Thu, 25 Jan 2024 16:48:15 -0600 Message-Id: <20240125224818.146499-7-milesg@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240125224818.146499-1-milesg@linux.vnet.ibm.com> References: <20240125224818.146499-1-milesg@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Xa0C6aA90UKLZhsJnVRkN3ccsZrw6ad8 X-Proofpoint-GUID: LCE1vnzBKbbBAgVHGB50e2sgtJmmwaf8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-25_14,2024-01-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 mlxlogscore=718 spamscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 impostorscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401250164 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=148.163.156.1; envelope-from=milesg@linux.vnet.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1706223032742100005 The QEMU I2C buses and devices use the resettable interface for resetting while the PNV I2C controller and parent buses and devices have not yet transitioned to this new interface and use the old reset strategy. This was preventing the I2C buses and devices wired to the PNV I2C controller from being reset. The short term fix for this is to have the PNV I2C Controller's reset function explicitly call the resettable interface function, bus_cold_reset(), on all child I2C buses. The long term fix should be to transition all PNV parent devices and buses to use the resettable interface so that all child buses and devices are automatically reset. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Glenn Miles --- No changes from previous version hw/ppc/pnv_i2c.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c index 656a48eebe..774946d6b2 100644 --- a/hw/ppc/pnv_i2c.c +++ b/hw/ppc/pnv_i2c.c @@ -629,6 +629,19 @@ static int pnv_i2c_dt_xscom(PnvXScomInterface *dev, vo= id *fdt, return 0; } =20 +static void pnv_i2c_sys_reset(void *dev) +{ + int port; + PnvI2C *i2c =3D PNV_I2C(dev); + + pnv_i2c_reset(dev); + + /* reset all buses connected to this i2c controller */ + for (port =3D 0; port < i2c->num_busses; port++) { + bus_cold_reset(BUS(i2c->busses[port])); + } +} + static void pnv_i2c_realize(DeviceState *dev, Error **errp) { PnvI2C *i2c =3D PNV_I2C(dev); @@ -654,7 +667,7 @@ static void pnv_i2c_realize(DeviceState *dev, Error **e= rrp) =20 fifo8_create(&i2c->fifo, PNV_I2C_FIFO_SIZE); =20 - qemu_register_reset(pnv_i2c_reset, dev); + qemu_register_reset(pnv_i2c_sys_reset, dev); =20 qdev_init_gpio_out(DEVICE(dev), &i2c->psi_irq, 1); } --=20 2.31.1