linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brandon Maier <brandon.maier@rockwellcollins.com>
To: monstr@monstr.eu
Cc: atull@kernel.org, mdf@kernel.org, linux-fpga@vger.kernel.org,
	Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Subject: Re: [PATCH] fpga: mgr: Use devicetree /alias to assign FPGA IDs
Date: Tue, 16 Apr 2019 11:08:24 -0500	[thread overview]
Message-ID: <CA+fik501cfCznG951=9oooTpN3T3Y+iSM8EW9DchCY6fFf7SAQ@mail.gmail.com> (raw)
In-Reply-To: <a3513e84-0328-b2ef-1ca2-1c563caf0e6d@monstr.eu>

On Tue, Apr 16, 2019 at 7:06 AM Michal Simek <monstr@monstr.eu> wrote:
>
> From the first look this is not proper implementation. It is not
> handling cases where you have mix of devices with and without aliases.
> If first mgr has no alias it gets 0, then second devices with fpga0
> alias can't take it even it is assign to it.

From what I can tell, most of the drivers that use of_alias_get_id()
work this way. They assume the devicetree will either contain aliases
for all devices, or none at all; and prints a dev_warn() if there's a
mismatch. Not to say this is the best solution, but it's the
precedent.

>
> For exactly this reason I have introduced of_alias_get_alias_list()
> and take a look at cdns_get_id() in serial driver how I am using it.

It looks like cdns_get_id() uses bitmaps instead of IDA to handle
this, which complicates this. I'd prefer to not pull in those changes
for now if that's ok with the maintainers.

I could see value in adding an of.h helper like of_alias_ida_get()
that handles the boiler plate stuff of requesting the alias ID and
searching for a valid ID, though.

>
> Thanks,
> Michal
>
> --
> Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
> w: www.monstr.eu p: +42-0-721842854
> Maintainer of Linux kernel - Xilinx Microblaze
> Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
> U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
>
>

Thanks,
Brandon

      reply	other threads:[~2019-04-16 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 22:11 [PATCH] fpga: mgr: Use devicetree /alias to assign FPGA IDs Brandon Maier
2019-04-15 18:31 ` Alan Tull
2019-04-16 12:05 ` Michal Simek
2019-04-16 16:08   ` Brandon Maier [this message]

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='CA+fik501cfCznG951=9oooTpN3T3Y+iSM8EW9DchCY6fFf7SAQ@mail.gmail.com' \
    --to=brandon.maier@rockwellcollins.com \
    --cc=atull@kernel.org \
    --cc=clayton.shotwell@rockwellcollins.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=monstr@monstr.eu \
    /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).