From: Alex Elder <elder@linaro.org>
To: Paolo Abeni <pabeni@redhat.com>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Cc: mka@chromium.org, andersson@kernel.org,
quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com,
quic_jponduru@quicinc.com, quic_subashab@quicinc.com,
elder@kernel.org, netdev@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 7/8] net: ipa: fix two minor ipa_cmd problems
Date: Tue, 23 Apr 2024 07:36:12 -0500 [thread overview]
Message-ID: <d6f8d978-350d-4867-be4e-beea0c7e467b@linaro.org> (raw)
In-Reply-To: <3a09d8e47e4c59aa4a42baae5b8a0886925a94a0.camel@redhat.com>
On 4/23/24 6:21 AM, Paolo Abeni wrote:
> On Fri, 2024-04-19 at 10:17 -0500, Alex Elder wrote:
>> In "ipa_cmd.h", ipa_cmd_data_valid() is declared, but that function
>> does not exist. So delete that declaration.
>>
>> Also, for some reason ipa_cmd_init() never gets called. It isn't
>> really critical--it just validates that some memory offsets and a
>> size can be represented in some register fields, and they won't fail
>> with current data. Regardless, call the function in ipa_probe().
>
> That name sounds confusing to me: I expect *init to allocate/set
> something that will need some reverse operation at shutdown/removal.
> What about a possible follow-up renaming the function to
> ipa_cmd_validate() or the like?
In the IPA driver I have several phases of initialization that
occur:
- *_init() is done to initialize anything (like allocating memory
and looking up DT information) that does not require any access
to hardware. Its inverse is *_exit().
- *_config() is done once "primitive" (register-based) access to
the hardware is needed, where the hardware must be clocked. Its
inverse is *_deconfig().
- *_setup() is done after the above, at a point where a higher-level
command-based (submit/await completion) interface is available.
That is used for the last steps of setting up the hardware. Its
inverse is *_teardown().
You're right, that in this case all this init function does is
validate things. But at an abstract level, this is the place
in the "IPA command" module where *any* early-stage initialization
takes place. The caller doesn't "know" that at the moment this
happens to only be validation. (I don't recall, but this might
previously have done some other things.)
So that's the reasoning behind the name. Changing it to
ipa_cmd_validate() makes sense too, but wouldn't fit the
pattern used elsewhere. I'm open to it though; it's just a
design choice. But unless you're convinced such a change
would really improve the code, I plan to leave it as-is.
> Not blocking the series, I'm applying it.
Thank you very much.
-Alex
> Thanks,
>
> Paolo
>
next prev parent reply other threads:[~2024-04-23 12:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 15:17 [PATCH net-next v2 0/8] net: ipa: eight simple cleanups Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 1/8] net: ipa: maintain bitmap of suspend-enabled endpoints Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 2/8] net: ipa: only enable the SUSPEND IPA interrupt when needed Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 3/8] net: ipa: call device_init_wakeup() earlier Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 4/8] net: ipa: remove unneeded FILT_ROUT_HASH_EN definitions Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 5/8] net: ipa: make ipa_table_hash_support() a real function Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 6/8] net: ipa: fix two bogus argument names Alex Elder
2024-04-19 15:17 ` [PATCH net-next v2 7/8] net: ipa: fix two minor ipa_cmd problems Alex Elder
2024-04-23 11:21 ` Paolo Abeni
2024-04-23 12:36 ` Alex Elder [this message]
2024-04-19 15:18 ` [PATCH net-next v2 8/8] net: ipa: kill ipa_version_supported() Alex Elder
2024-04-23 11:30 ` [PATCH net-next v2 0/8] net: ipa: eight simple cleanups patchwork-bot+netdevbpf
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=d6f8d978-350d-4867-be4e-beea0c7e467b@linaro.org \
--to=elder@linaro.org \
--cc=andersson@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elder@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_avuyyuru@quicinc.com \
--cc=quic_cpratapa@quicinc.com \
--cc=quic_jponduru@quicinc.com \
--cc=quic_subashab@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox