linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	"krzysztof.kozlowski+dt@linaro.org" 
	<krzysztof.kozlowski+dt@linaro.org>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"wei.liu@kernel.org" <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH v7 5/5] Driver: VMBus: Add Devicetree support
Date: Sun, 12 Mar 2023 23:16:03 -0700	[thread overview]
Message-ID: <20230313061603.GA8934@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <BYAPR21MB1688B84E25DD2173B6023737D7B99@BYAPR21MB1688.namprd21.prod.outlook.com>

On Mon, Mar 13, 2023 at 02:33:53AM +0000, Michael Kelley (LINUX) wrote:
> From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Thursday, February 23, 2023 3:29 AM
> > 
> > Update the driver to support Devicetree boot as well along with ACPI.
> > At present the Devicetree parsing only provides the mmio region info
> > and is not the exact copy of ACPI parsing. This is sufficient to cater
> > all the current Devicetree usecases for VMBus.
> > 
> > Currently Devicetree is supported only for x86 systems.
> > 
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> > [V7]
> > - Use cpu_addr instead of bus_addr
> > 
> >  drivers/hv/Kconfig     |  6 +++--
> >  drivers/hv/vmbus_drv.c | 57 ++++++++++++++++++++++++++++++++++++++++--
> >  2 files changed, 59 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
> > index 0747a8f1fcee..1a55bf32d195 100644
> > --- a/drivers/hv/Kconfig
> > +++ b/drivers/hv/Kconfig
> > @@ -4,11 +4,13 @@ menu "Microsoft Hyper-V guest support"
> > 
> >  config HYPERV
> >  	tristate "Microsoft Hyper-V client drivers"
> > -	depends on ACPI && ((X86 && X86_LOCAL_APIC && HYPERVISOR_GUEST) \
> > -		|| (ARM64 && !CPU_BIG_ENDIAN))
> > +	depends on (X86 && X86_LOCAL_APIC && HYPERVISOR_GUEST) \
> > +		|| (ACPI && ARM64 && !CPU_BIG_ENDIAN)
> >  	select PARAVIRT
> >  	select X86_HV_CALLBACK_VECTOR if X86
> >  	select VMAP_PFN
> > +	select OF if !ACPI
> > +	select OF_EARLY_FLATTREE if !ACPI
> >  	help
> >  	  Select this option to run Linux as a Hyper-V client operating
> >  	  system.
> 
> One further thing occurred to me.  OF_EARLY_FLATTREE really depends
> on OF instead of ACPI.   The ACPI dependency is indirect through OF.  So
> I'd suggest doing
> 
> 	select OF_EARLY_FLATTRE if OF
> 
> to express the direct dependency.

As you pointed out OF_EARLY_FLATTRE is anyway dependent on OF, and thus I
feel this check is redundant. I see all the Kconfig options which enables
both of these flags don't explicitly mention this dependency.

> 
> Separately, I wonder if the "select OF if !ACPI" is even needed.  It doesn't
> hurt anything to leave it, but it seems like any config that doesn't
> independently select either ACPI or OF is broken for reasons unrelated
> to Hyper-V.  I'm OK with leaving the select of OF if you want, so I'm
> more just wondering than asserting it should be removed.   I didn't
> see "select OF if !ACPI" anywhere else in the Kconfig files, and it
> seems like Hyper-V would not be the only environment where this
> is the expectation.

Ok I can remove the !ACPI dependency. Hope kernel size increase due to both
the code compiled in shouldn't be problem for ACPI systems.
And here if config doesn't select ACPI or OF it will assume OF, which is
better then selecting none of them.


To address both of your comments I feel below will be sufficient:
select OF
select OF_EARLY_FLATTRE


Regards,
Saurabh

> 
> Michael

  reply	other threads:[~2023-03-13  6:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 11:29 [PATCH v7 0/5] Device tree support for Hyper-V VMBus driver Saurabh Sengar
2023-02-23 11:29 ` [PATCH v7 1/5] drivers/clocksource/hyper-v: non ACPI support in hyperv clock Saurabh Sengar
2023-02-23 11:29 ` [PATCH v7 2/5] ACPI: bus: Add stub acpi_sleep_state_supported() in non-ACPI cases Saurabh Sengar
2023-02-23 11:29 ` [PATCH v7 3/5] Drivers: hv: vmbus: Convert acpi_device to more generic platform_device Saurabh Sengar
2023-02-23 11:29 ` [PATCH v7 4/5] dt-bindings: bus: VMBus Saurabh Sengar
2023-03-06  7:49   ` Saurabh Singh Sengar
2023-03-08 18:53   ` Rob Herring
2023-02-23 11:29 ` [PATCH v7 5/5] Driver: VMBus: Add Devicetree support Saurabh Sengar
2023-03-09 21:16   ` Wei Liu
2023-03-10  5:34     ` Saurabh Singh Sengar
2023-03-12 13:08       ` Michael Kelley (LINUX)
2023-03-12 17:39         ` Saurabh Singh Sengar
2023-03-13  2:27           ` Michael Kelley (LINUX)
2023-03-13  2:33   ` Michael Kelley (LINUX)
2023-03-13  6:16     ` Saurabh Singh Sengar [this message]
2023-03-13 12:26       ` Michael Kelley (LINUX)
2023-03-13 13:37         ` Saurabh Singh Sengar

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=20230313061603.GA8934@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=ssengar@linux.microsoft.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=decui@microsoft.com \
    --cc=devicetree@vger.kernel.org \
    --cc=haiyangz@microsoft.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kys@microsoft.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wei.liu@kernel.org \
    /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).