From nobody Wed Nov 19 08:26:29 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615395977; cv=none; d=zohomail.com; s=zohoarc; b=V14oQ3ku9VvT6K1HoIZnwm+ebNUT8IuL7TyGmOAHptcyguGCCJ93mucie0EJSwoj4V7TkNYL66nf23oEY1YFSRW9/y0NH6IWbSgYVhJCYFtSPhbU1UFqWAqlByTdWg8Kk28zbiSYfK96Ykm8qxtxvtbAHygYW5b80OF4InMDu2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615395977; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=XgHB9Xq4JwDA4FPpoAiA/3Du3vBPCn/Cbea9/ueFNnI=; b=Rs6Sx5epgBZyo29Z7uSiqFPZtEfFc5e6/e2GLAxJogN4r8gNthIi5w1pSLdHaEhqS5l0XKQHdBWv+GOqoBZn9bu3u5hzEPrXnOsBi2NGvM8zbrZ9vneMklhT0c8sVQmKj7GQzFAhacnCwvdDircyrT6hmC33T4cxFykqQhDGRMU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615395977781485.6363115432631; Wed, 10 Mar 2021 09:06:17 -0800 (PST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-L1MGWzuYNyCKyegHSwrSjQ-1; Wed, 10 Mar 2021 12:06:15 -0500 Received: by mail-ed1-f69.google.com with SMTP id p12so8682525edw.9 for ; Wed, 10 Mar 2021 09:06:14 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id k22sm10754965edv.33.2021.03.10.09.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 09:06:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615395976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XgHB9Xq4JwDA4FPpoAiA/3Du3vBPCn/Cbea9/ueFNnI=; b=gMvPi0NdRzHEyZ2uqPwpeQPhWKG5P+C/yM3/h0O8QGcSv8dUzX5EdY8R2ZoWF9eyqafwDW cecdm6zBip6L0isOC07pRJpLby4zEACLttpEjErsjz6MstAm3ha/4k6YnQTBDZrwVEKb5/ eOiYeEAc4TY99FZBuzGYWjDOzNO/glI= X-MC-Unique: L1MGWzuYNyCKyegHSwrSjQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XgHB9Xq4JwDA4FPpoAiA/3Du3vBPCn/Cbea9/ueFNnI=; b=kOtY1UN+GC+cdH8AYv4dgrQCP7IyiSi3SL0ISkeGRgQQSuTczV8ZsgBYNt0VBF8Bzd E4OSkf1eApEHSRglvnBgCuHTGli78G+pFWn5T5shHO746VN1PFSw+gu7Y7KYOfncj1Jt /YmOsEKmG3qJn+ije6KBLrHndftoQ8RRju4btGAap8Bl+iGvOplx8ivNiUno5OQYd/z7 Q7z38tpvsAciuGIP2y3U09nztk12K5TVPrGkMtYIuz+l/jaT6ivqHdj6LyoaW6Ci05nO +PsmOQyRsiwrxLNo3UENXzsbmNULS8NlgvFly10saLeeEOh/Z++YT+UZ/Q4kXwemm5QM 03mA== X-Gm-Message-State: AOAM530xKnutkGmAmO05T+9HZ0XeYirm4RItSNdsteufIv1hljCIR/6l ROuzHPxIwqFWtsE9K838lUcsta82w0anWpleT06rXzXFpIEik5u99nTM44EFAHrBIpgKxRauw1K TcO0zeMyotW07jg== X-Received: by 2002:a05:6402:38d:: with SMTP id o13mr4362975edv.337.1615395973848; Wed, 10 Mar 2021 09:06:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZmQbEY1cvOWYdoMQ8AkvAE1xbmX5mD+DCL3rttFX6aoThbfIdVIPeU156u+XLQsQKn+xopw== X-Received: by 2002:a05:6402:38d:: with SMTP id o13mr4362953edv.337.1615395973696; Wed, 10 Mar 2021 09:06:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Max Reitz , David Edmondson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Stephen Checkoway , Kevin Wolf Subject: [PATCH v2 08/12] hw/block/pflash_cfi02: Add DeviceReset method Date: Wed, 10 Mar 2021 18:05:24 +0100 Message-Id: <20210310170528.1184868-9-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210310170528.1184868-1-philmd@redhat.com> References: <20210310170528.1184868-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bin Meng Reviewed-by: David Edmondson --- hw/block/pflash_cfi02.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index aea47a99c61..c40febd2a41 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -942,6 +942,13 @@ static void pflash_cfi02_realize(DeviceState *dev, Err= or **errp) pflash_cfi02_fill_cfi_table(pfl, nb_regions); } =20 +static void pflash_cfi02_reset(DeviceState *dev) +{ + PFlashCFI02 *pfl =3D PFLASH_CFI02(dev); + + pflash_reset_state_machine(pfl); +} + static Property pflash_cfi02_properties[] =3D { DEFINE_PROP_DRIVE("drive", PFlashCFI02, blk), DEFINE_PROP_UINT32("num-blocks", PFlashCFI02, uniform_nb_blocs, 0), @@ -979,6 +986,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass,= void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->realize =3D pflash_cfi02_realize; + dc->reset =3D pflash_cfi02_reset; dc->unrealize =3D pflash_cfi02_unrealize; device_class_set_props(dc, pflash_cfi02_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); --=20 2.26.2