All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair.francis@xilinx.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Alistair Francis <alistair.francis@xilinx.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Fam Zheng <famz@redhat.com>, Xiaoqiang Zhao <zxq_yx_007@163.com>,
	"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Prasad J Pandit <pjp@fedoraproject.org>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Andrew Baumann <Andrew.Baumann@microsoft.com>,
	Sai Pavan Boddu <saipava@xilinx.com>,
	Michael Walle <michael@walle.cc>, qemu-arm <qemu-arm@nongnu.org>,
	Andrey Yurovsky <yurovsky@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v2 04/20] sdhci: refactor same sysbus/pci properties into a common one
Date: Wed, 3 Jan 2018 11:36:47 -0800	[thread overview]
Message-ID: <CAKmqyKNmr8WcQ1X3aWe4rhRQxwtz68Pm1RicqPdT=2PEqnmnXw@mail.gmail.com> (raw)
In-Reply-To: <f261cae0-9026-9ef0-65c5-fb24076564d8@amsat.org>

On Fri, Dec 29, 2017 at 9:21 AM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Hi Alistair,
>
> On 12/18/2017 10:13 PM, Alistair Francis wrote:
>> On Thu, Dec 14, 2017 at 7:15 PM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>> add sysbus/pci/sdbus separator comments to keep it clearer
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>> I'm still unsure about this. Won't this leave us with properties that
>> have no impact on the device? That seems very confusing to me.
>
> (from previous series)
>> [...] but aren't we now going to
>> have device properties that aren't actually connected to anything?
>
> I'm also confused :)
>
> My understanding is the "pending-insert-quirk" worries you.

Exactly, my worry is having properties that aren't connected. As a
user I expect that if I set a property that will have some effect on
how QEMU runs. A un-connected property is just confusing.

> This property is dependent of the HCI IP, so regardless the HCI is
> accessed through a MMIO sysbus or a PCI bus the quirk might exists (for
> this property, only the BCM implementation).

So it has always been configuration dependent?

Alistair

>
> With v3 series applied, the monitor 'qtree' output is:
>
> $ qemu-system-aarch64 -M xlnx-zcu102 -monitor stdio -S
> (qemu) info qtree
>   dev: generic-sdhci, id ""
>     gpio-out "sysbus-irq" 1
>     sd-spec-version = 3 (0x3)
>     timeout-freq = 0 (0x0)
>     freq-in-mhz = true
>     clock-freq = 0 (0x0)
>     max-block-length = 512 (0x200)
>     dma = true
>     sdma = true
>     adma1 = false
>     adma2 = true
>     suspend = true
>     high-speed = true
>     3v3 = true
>     3v0 = false
>     1v8 = true
>     64bit = true
>     slot-type = 0 (0x0)
>     bus-speed = 7 (0x7)
>     driver-strength = 7 (0x7)
>     maxcurr = 0 (0x0)
>     pending-insert-quirk = false
>     dma-memory = ""
>     mmio 00000000ff170000/0000000000000100
>     bus: sd-bus
>       type sdhci-bus
>       dev: sd-card, id ""
>         drive = ""
>         spi = false
>
> Are you worried about this output?
>
>>> ---
>>>  hw/sd/sdhci.c | 21 ++++++++++-----------
>>>  1 file changed, 10 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
>>> index 2823da00da..dbdfd54350 100644
>>> --- a/hw/sd/sdhci.c
>>> +++ b/hw/sd/sdhci.c
>>> @@ -1265,13 +1265,17 @@ const VMStateDescription sdhci_vmstate = {
>>>
>>>  /* Capabilities registers provide information on supported features of this
>>>   * specific host controller implementation */
>>> -static Property sdhci_pci_properties[] = {
>>> +static Property sdhci_properties[] = {
>>>      DEFINE_PROP_UINT32("capareg", SDHCIState, capareg,
>>>              SDHC_CAPAB_REG_DEFAULT),
>>>      DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0),
>>> +    DEFINE_PROP_BOOL("pending-insert-quirk", SDHCIState, pending_insert_quirk,
>>> +                     false),
>>>      DEFINE_PROP_END_OF_LIST(),
>>>  };
>>>
>>> +/* --- qdev PCI --- */
>>> +
>>>  static void sdhci_pci_realize(PCIDevice *dev, Error **errp)
>>>  {
>>>      SDHCIState *s = PCI_SDHCI(dev);
>>> @@ -1304,7 +1308,7 @@ static void sdhci_pci_class_init(ObjectClass *klass, void *data)
>>>      k->class_id = PCI_CLASS_SYSTEM_SDHCI;
>>>      set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
>>>      dc->vmsd = &sdhci_vmstate;
>>> -    dc->props = sdhci_pci_properties;
>>> +    dc->props = sdhci_properties;
>>>      dc->reset = sdhci_poweron_reset;
>>>  }
>>>
>>> @@ -1319,14 +1323,7 @@ static const TypeInfo sdhci_pci_info = {
>>>      },
>>>  };
>>>
>>> -static Property sdhci_sysbus_properties[] = {
>>> -    DEFINE_PROP_UINT32("capareg", SDHCIState, capareg,
>>> -            SDHC_CAPAB_REG_DEFAULT),
>>> -    DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0),
>>> -    DEFINE_PROP_BOOL("pending-insert-quirk", SDHCIState, pending_insert_quirk,
>>> -                     false),
>>> -    DEFINE_PROP_END_OF_LIST(),
>>> -};
>>> +/* --- qdev SysBus --- */
>>>
>>>  static void sdhci_sysbus_init(Object *obj)
>>>  {
>>> @@ -1359,7 +1356,7 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data)
>>>      DeviceClass *dc = DEVICE_CLASS(klass);
>>>
>>>      dc->vmsd = &sdhci_vmstate;
>>> -    dc->props = sdhci_sysbus_properties;
>>> +    dc->props = sdhci_properties;
>>>      dc->realize = sdhci_sysbus_realize;
>>>      dc->reset = sdhci_poweron_reset;
>>>  }
>>> @@ -1373,6 +1370,8 @@ static const TypeInfo sdhci_sysbus_info = {
>>>      .class_init = sdhci_sysbus_class_init,
>>>  };
>>>
>>> +/* --- qdev bus master --- */
>>> +
>>>  static void sdhci_bus_class_init(ObjectClass *klass, void *data)
>>>  {
>>>      SDBusClass *sbc = SD_BUS_CLASS(klass);
>>> --
>>> 2.15.1
>>>
>>>
>

  reply	other threads:[~2018-01-03 19:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15  3:15 [Qemu-devel] [PATCH v2 00/20] SDHCI: housekeeping, add a qtest and fix few issues Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 01/20] sdhci: clean up includes Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 02/20] sdhci: use deposit64() Philippe Mathieu-Daudé
2017-12-19  1:16   ` Alistair Francis
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 03/20] sdhci: move MASK_TRNMOD with other SDHC_TRN* defines in "sd-internal.h" Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 04/20] sdhci: refactor same sysbus/pci properties into a common one Philippe Mathieu-Daudé
2017-12-19  1:13   ` Alistair Francis
2017-12-29 17:21     ` Philippe Mathieu-Daudé
2018-01-03 19:36       ` Alistair Francis [this message]
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 05/20] sdhci: refactor common sysbus/pci realize() into sdhci_realizefn() Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 06/20] sdhci: refactor common sysbus/pci class_init() into sdhci_class_init() Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 07/20] sdhci: refactor common sysbus/pci unrealize() into sdhci_unrealizefn() Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 08/20] sdhci: use qemu_log_mask(UNIMP) instead of fprintf() Philippe Mathieu-Daudé
2017-12-19  1:16   ` Alistair Francis
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 09/20] sdhci: convert the DPRINT() calls into trace events Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 10/20] sdhci: add a GPIO for the access control LED Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 11/20] sdhci: add a "dma-memory" property Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 12/20] sdhci: fix CAPAB/MAXCURR registers, both are 64bit and read-only Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 13/20] sdhci: Implement write method of ACMD12ERRSTS register Philippe Mathieu-Daudé
2017-12-19  1:18   ` Alistair Francis
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 14/20] sdhci: add a "sd-spec-version" property Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 15/20] sdhci: some ARM boards do support SD_HOST_SPECv3_VERS Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 16/20] sdhci: add qtest to check the SD Spec version Philippe Mathieu-Daudé
2017-12-18 15:27   ` Stefan Hajnoczi
2017-12-18 23:10   ` Philippe Mathieu-Daudé
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 17/20] sdhci: add check_capab_readonly() qtest Philippe Mathieu-Daudé
2017-12-18 17:00   ` Stefan Hajnoczi
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 18/20] sdhci: add a check_capab_baseclock() qtest Philippe Mathieu-Daudé
2017-12-18 17:00   ` Stefan Hajnoczi
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 19/20] sdhci: add a check_capab_sdma() qtest Philippe Mathieu-Daudé
2017-12-18 17:01   ` Stefan Hajnoczi
2017-12-15  3:15 ` [Qemu-devel] [PATCH v2 20/20] sdhci: add a check_capab_v3() qtest Philippe Mathieu-Daudé
2017-12-18 17:01   ` Stefan Hajnoczi

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='CAKmqyKNmr8WcQ1X3aWe4rhRQxwtz68Pm1RicqPdT=2PEqnmnXw@mail.gmail.com' \
    --to=alistair.francis@xilinx.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=michael@walle.cc \
    --cc=peter.maydell@linaro.org \
    --cc=pjp@fedoraproject.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=saipava@xilinx.com \
    --cc=yurovsky@gmail.com \
    --cc=zxq_yx_007@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.