From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Hao Wu <wuhaotsh@google.com>,
richard.henderson@linaro.org, qemu-arm@nongnu.org,
qemu-devel@nongnu.org, venture@google.com,
Avi.Fishman@nuvoton.com, kfting@nuvoton.com,
hskinnemoen@google.com, f4bug@amsat.org,
bin.meng@windriver.com, qemu-block@nongnu.org,
thuth@redhat.com, Hanna Reitz <hreitz@redhat.com>
Subject: Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER
Date: Thu, 04 Aug 2022 16:27:41 +0200 [thread overview]
Message-ID: <874jysf5ia.fsf@pond.sub.org> (raw)
In-Reply-To: <CAFEAcA_=PPJO5K8r5QFKJRhX4j9jwPPSceAUPjhK0z_bmLdyrA@mail.gmail.com> (Peter Maydell's message of "Thu, 28 Jul 2022 15:58:51 +0100")
Peter Maydell <peter.maydell@linaro.org> writes:
> On Thu, 28 Jul 2022 at 15:50, Markus Armbruster <armbru@redhat.com> wrote:
>> Kevin Wolf <kwolf@redhat.com> writes:
>> >
>> > But if you have more than one device, it becomes hard to predict which
>> > device gets which backend - it depends on the initialisation order in
>> > the code then,
>>
>> Really? Board code should use IF_OTHER devices just like it uses the
>> other interface types, namely connecting each frontend device to a
>> backend device with a well-known and fixed interface type and index (or
>> bus and unit instead, where appropriate).
>
> I think part of the problem is that unlike the typical disk
> interface, where there is some idea of bus-and-unit-number or
> index number that it makes sense to expose to users, these
> "miscellaneous storage" devices don't have any particular index
> concept -- in the real hardware there are just a random set of
> devices that are connected in various places. So you're requiring
> users to look up the documentation for "index 0 is this eeprom,
> index 1 is that other eeprom, index 2 is ...".
"Unit number on a bus" makes perfect sense for SCSI and PATA. For SATA,
the only valid unit number is 0, which may or may not make sense to
users. Not a problem in practice, though.
Bus numbers are arbitrary, though. Harmless enough when you have to
deal only with very few of them, e.g. a single SCSI HBA (one bus, number
0), a single PATA HBA (two buses, number 0 and 1), a single SATA HBA
(typically six buses, numbers 0..5).
For anything else, we use "index" rather than "bus" and "unit", and the
indexes are completely arbitrary. Again, harmless enough when you have
to deal only with a few of each interface type.
*Names* rather than arbitrary index or bus numbers would arguably be a
better interface.
Nothing of this is new with IF_OTHER.
next prev parent reply other threads:[~2022-08-04 14:28 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 18:28 [PATCH v5 0/8] Misc NPCM7XX patches Hao Wu
2022-07-14 18:28 ` [PATCH v5 1/8] hw/i2c: Clear ACK bit in NPCM7xx SMBus module Hao Wu
2022-07-14 18:28 ` [PATCH v5 2/8] hw/i2c: Read FIFO during RXF_CTL change in NPCM7XX SMBus Hao Wu
2022-07-15 15:37 ` Peter Maydell
2022-07-14 18:28 ` [PATCH v5 3/8] hw/adc: Fix CONV bit in NPCM7XX ADC CON register Hao Wu
2022-07-14 18:28 ` [PATCH v5 4/8] hw/adc: Make adci[*] R/W in NPCM7XX ADC Hao Wu
2022-07-14 18:28 ` [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER Hao Wu
2022-07-18 9:49 ` Markus Armbruster
2022-07-18 9:54 ` Thomas Huth
2022-07-27 19:03 ` Kevin Wolf
2022-07-28 9:46 ` Peter Maydell
2022-07-28 13:29 ` Kevin Wolf
2022-07-28 13:43 ` Peter Maydell
2022-07-28 13:57 ` Cédric Le Goater
2022-07-28 14:50 ` Markus Armbruster
2022-07-28 14:58 ` Peter Maydell
2022-08-04 14:27 ` Markus Armbruster [this message]
2022-07-28 17:08 ` Kevin Wolf
2022-08-04 14:34 ` Daniel P. Berrangé
2022-08-04 14:56 ` Markus Armbruster
2022-08-04 15:17 ` Daniel P. Berrangé
2022-08-04 15:30 ` Markus Armbruster
2022-08-04 15:44 ` Daniel P. Berrangé
2022-08-08 6:26 ` Markus Armbruster
2022-08-08 8:34 ` Kevin Wolf
2022-08-08 10:14 ` Markus Armbruster
2022-07-14 18:28 ` [PATCH v5 6/8] hw/arm: npcm8xx_boards: EEPROMs can take bus as parameter Hao Wu
2022-07-14 18:28 ` [PATCH v5 7/8] hw/arm: Set drive property for at24c eeprom Hao Wu
2022-07-18 9:51 ` Markus Armbruster
2022-07-14 18:28 ` [PATCH v5 8/8] hw/arm: quanta-gbs-bmc add i2c devices Hao Wu
2022-07-15 15:44 ` [PATCH v5 0/8] Misc NPCM7XX patches Peter Maydell
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=874jysf5ia.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=Avi.Fishman@nuvoton.com \
--cc=bin.meng@windriver.com \
--cc=f4bug@amsat.org \
--cc=hreitz@redhat.com \
--cc=hskinnemoen@google.com \
--cc=kfting@nuvoton.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=venture@google.com \
--cc=wuhaotsh@google.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.