From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: Nuno Sa <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Olivier Moysan <olivier.moysan@foss.st.com>
Subject: Re: [PATCH v4 6/8] iio: add the IIO backend framework
Date: Tue, 26 Dec 2023 15:59:04 +0000 [thread overview]
Message-ID: <20231226155904.043fee13@jic23-huawei> (raw)
In-Reply-To: <f7df488b33c89ce7078c39a87ba1108fac5a10bd.camel@gmail.com>
> > > +
> > > + ret = devm_add_action_or_reset(dev, iio_backend_release, back);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + link = device_link_add(dev, back->dev, DL_FLAG_AUTOREMOVE_CONSUMER);
> > > + if (!link)
> > > + pr_warn("%s: Could not link to supplier(%s)\n", dev_name(dev),
> > > + dev_name(back->dev));
> >
> > Why is that not an error and we try to carry on?
>
> I guess having the links are not really mandatory for the whole thing to work (more
> like a nice to have). That's also how this is handled in another subsystems so I
> figured it would be fine.
>
> But since you are speaking about this... After you pointing me to Bartosz's talk and
> sawing it (as stuff like this is mentioned), I started to question this. The goal
> with the above comment is that if you remove the backend, all the consumers are
> automatically removed (unbound). Just not sure if that's what we always want (and we
> are already handling the situation where a backend goes away with -ENODEV) as some
> frontends could still be useful without the backend (I guess that could be
> plausible). I think for now we don't really have such usecases so the links can make
> sense (and we can figure something like optionally creating these links if we ever
> need too) but having your inputs on this will definitely be valuable.
I'm not keen on both trying to make everything tear down cleanly AND making sure
it all works even if we don't. That just adds two code paths to test when either
should be sufficient on its own. I don't really mind which. Bartosz's stuff
is nice, but it may not be the right solution here.
>
> > > +
> > > + pr_debug("%s: Found backend(%s) device\n", dev_name(dev),
> > > + dev_name(back->dev));
> > > + return 0;
> > > +}
> > > +
Jonathan
next prev parent reply other threads:[~2023-12-26 15:59 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 15:34 [PATCH v4 0/8] iio: add new backend framework Nuno Sa
2023-12-20 15:34 ` [PATCH v4 1/8] dt-bindings: adc: ad9467: add new io-backend property Nuno Sa
2023-12-20 16:56 ` Rob Herring
2023-12-21 17:21 ` Jonathan Cameron
2023-12-21 22:46 ` Rob Herring
2023-12-20 15:34 ` [PATCH v4 2/8] dt-bindings: adc: axi-adc: deprecate 'adi,adc-dev' Nuno Sa
2023-12-21 17:25 ` Jonathan Cameron
2023-12-22 9:07 ` Nuno Sá
2023-12-26 15:55 ` Jonathan Cameron
2023-12-20 15:34 ` [PATCH v4 3/8] driver: core: allow modifying device_links flags Nuno Sa
2023-12-20 15:34 ` [PATCH v4 4/8] of: property: add device link support for io-backends Nuno Sa
2023-12-21 22:47 ` Rob Herring
2024-01-03 21:39 ` David Lechner
2024-01-09 11:23 ` Nuno Sá
2023-12-20 15:34 ` [PATCH v4 5/8] iio: buffer-dmaengine: export buffer alloc and free functions Nuno Sa
2023-12-20 15:34 ` [PATCH v4 6/8] iio: add the IIO backend framework Nuno Sa
2023-12-21 17:44 ` Jonathan Cameron
2023-12-22 9:39 ` Nuno Sá
2023-12-26 15:59 ` Jonathan Cameron [this message]
2024-01-09 12:15 ` Nuno Sá
2024-01-10 9:16 ` Jonathan Cameron
2024-01-10 10:37 ` Nuno Sá
2024-01-11 15:07 ` Olivier MOYSAN
2023-12-20 15:34 ` [PATCH v4 7/8] iio: adc: ad9467: convert to " Nuno Sa
2023-12-21 17:52 ` Jonathan Cameron
2023-12-22 9:10 ` Nuno Sá
2023-12-20 15:34 ` [PATCH v4 8/8] iio: adc: adi-axi-adc: move " Nuno Sa
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=20231226155904.043fee13@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=noname.nuno@gmail.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=rafael@kernel.org \
--cc=robh+dt@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).