qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com, xiaoguangrong.eric@gmail.com
Subject: Re: [Qemu-devel] [PATCH 4/4] nvdimm: build FIT in nvdimm_build_acpi
Date: Wed, 6 Mar 2019 17:14:06 +0100	[thread overview]
Message-ID: <20190306171406.6e67d7ca@Igors-MacBook-Pro.local> (raw)
In-Reply-To: <20190227075101.6263-5-richardw.yang@linux.intel.com>

On Wed, 27 Feb 2019 15:51:01 +0800
Wei Yang <richardw.yang@linux.intel.com> wrote:

> Currently we initialize nvdimm device like below:
> 
>     device_set_realized
>         dc->realize
> 	nvdimm_plug
> 	    nvdimm_build_fit_buffer
>     acpi_build
>         nvdimm_build_acpi
> 
> This shows nvdimm's acpi stuff is prepared in two places:
> 
>     * device plug stage
>     * acpi_build stage
> 
> It would be more proper to build fit buffer in nvdimm_build_acpi, which
> consolidate all acpi related initialization together.
> 
> This patch moves FIT build in nvdimm_build_acpi.

Does hotplug work after this change?

> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
>  hw/acpi/nvdimm.c        | 6 +-----
>  hw/i386/pc.c            | 5 -----
>  include/hw/mem/nvdimm.h | 1 -
>  3 files changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index 2457c1aa44..6fc0c65ee0 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -425,11 +425,6 @@ static void nvdimm_build_fit_buffer(AcpiNVDIMMState *state)
>      fit_buf->dirty = true;
>  }
>  
> -void nvdimm_plug(AcpiNVDIMMState *state)
> -{
> -    nvdimm_build_fit_buffer(state);
> -}
> -
>  static void nvdimm_build_nfit(AcpiNVDIMMState *state, GArray *table_offsets,
>                                GArray *table_data, BIOSLinker *linker)
>  {
> @@ -1338,6 +1333,7 @@ void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
>          return;
>      }
>  
> +    nvdimm_build_fit_buffer(state);
>      nvdimm_build_nfit(state, table_offsets, table_data, linker);
>      g_slist_free(device_list);
>  }
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 64d9e756fa..686b610c50 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -2099,17 +2099,12 @@ static void pc_memory_plug(HotplugHandler *hotplug_dev,
>  {
>      Error *local_err = NULL;
>      PCMachineState *pcms = PC_MACHINE(hotplug_dev);
> -    bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
>  
>      pc_dimm_plug(PC_DIMM(dev), MACHINE(pcms), &local_err);
>      if (local_err) {
>          goto out;
>      }
>  
> -    if (is_nvdimm) {
> -        nvdimm_plug(&pcms->acpi_nvdimm_state);
> -    }
> -
>      hotplug_handler_plug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &error_abort);
>  out:
>      error_propagate(errp, local_err);
> diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h
> index c5c9b3c7f8..30869b4834 100644
> --- a/include/hw/mem/nvdimm.h
> +++ b/include/hw/mem/nvdimm.h
> @@ -148,6 +148,5 @@ void nvdimm_init_acpi_state(AcpiNVDIMMState *state, MemoryRegion *io,
>  void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
>                         BIOSLinker *linker, AcpiNVDIMMState *state,
>                         uint32_t ram_slots);
> -void nvdimm_plug(AcpiNVDIMMState *state);
>  void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev);
>  #endif

  reply	other threads:[~2019-03-06 16:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27  7:50 [Qemu-devel] [PATCH 0/4] nvdimm: clean up Wei Yang
2019-02-27  7:50 ` [Qemu-devel] [PATCH 1/4] nvdimm: fix typo in nvdimm_build_nvdimm_devices argument Wei Yang
2019-03-06 16:00   ` Igor Mammedov
2019-02-27  7:50 ` [Qemu-devel] [PATCH 2/4] nvdimm: use *function* directly instead of allocating it again Wei Yang
2019-03-06 16:02   ` Igor Mammedov
2019-02-27  7:51 ` [Qemu-devel] [PATCH 3/4] nvdimm: use NVDIMM_ACPI_IO_LEN for the proper IO size Wei Yang
2019-03-06 16:10   ` Igor Mammedov
2019-02-27  7:51 ` [Qemu-devel] [PATCH 4/4] nvdimm: build FIT in nvdimm_build_acpi Wei Yang
2019-03-06 16:14   ` Igor Mammedov [this message]
2019-03-07  3:41     ` Wei Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190306171406.6e67d7ca@Igors-MacBook-Pro.local \
    --to=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richardw.yang@linux.intel.com \
    --cc=xiaoguangrong.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).