From: David Miller <davem@davemloft.net>
To: elder@linaro.org
Cc: kuba@kernel.org, evgreen@chromium.org, subashab@codeaurora.org,
cpratapa@codeaurora.org, bjorn.andersson@linaro.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/5] net: ipa: head-of-line block registers are RX only
Date: Mon, 29 Jun 2020 18:03:05 -0700 (PDT) [thread overview]
Message-ID: <20200629.180305.1550276438848153234.davem@davemloft.net> (raw)
In-Reply-To: <7c438ee3-8ff0-0ee1-2a0a-fa458d982e11@linaro.org>
From: Alex Elder <elder@linaro.org>
Date: Mon, 29 Jun 2020 20:01:20 -0500
> On 6/29/20 7:35 PM, Jakub Kicinski wrote:
>> On Mon, 29 Jun 2020 16:49:15 -0500 Alex Elder wrote:
>>> The INIT_HOL_BLOCK_EN and INIT_HOL_BLOCK_TIMER endpoint registers
>>> are only valid for RX endpoints.
>>>
>>> Have ipa_endpoint_modem_hol_block_clear_all() skip writing these
>>> registers for TX endpoints.
>>>
>>> Signed-off-by: Alex Elder <elder@linaro.org>
>>> ---
>>> drivers/net/ipa/ipa_endpoint.c | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c
>>> index 9f50d0d11704..3f5a41fc1997 100644
>>> --- a/drivers/net/ipa/ipa_endpoint.c
>>> +++ b/drivers/net/ipa/ipa_endpoint.c
>>> @@ -642,6 +642,8 @@ static int ipa_endpoint_init_hol_block_timer(struct ipa_endpoint *endpoint,
>>> u32 offset;
>>> u32 val;
>>>
>>> + /* assert(!endpoint->toward_ipa); */
>>> +
>>> /* XXX We'll fix this when the register definition is clear */
>>> if (microseconds) {
>>> struct device *dev = &ipa->pdev->dev;
>>> @@ -671,6 +673,8 @@ ipa_endpoint_init_hol_block_enable(struct ipa_endpoint *endpoint, bool enable)
>>> u32 offset;
>>> u32 val;
>>>
>>> + /* assert(!endpoint->toward_ipa); */
>>
>> What are these assert comments for? :S
>
> They are place holders for when I can put in a proper assert
> function. For now I'm trying to avoid BUG_ON() calls, but
> at some point soon I'll replace these comments with calls
> to a macro that does BUG_ON() conditioned on a config option
> (or something else if there's a better suggestion).
>
> Even though it's commented, the assert() call does what
> I want, which is to communicate to the reader a condition
> assumed by the code, succinctly.
Never BUG_ON() unless you absolutely cannot continue executing kernel
without corrupting memory or similar.
If you can error out in some way at all, do not BUG().
next prev parent reply other threads:[~2020-06-30 1:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 21:49 [PATCH net-next 0/5] net: ipa: endpoint configuration updates Alex Elder
2020-06-29 21:49 ` [PATCH net-next 1/5] net: ipa: head-of-line block registers are RX only Alex Elder
2020-06-30 0:35 ` Jakub Kicinski
2020-06-30 1:01 ` Alex Elder
2020-06-30 1:03 ` David Miller [this message]
2020-06-30 1:09 ` Alex Elder
2020-06-30 19:21 ` David Miller
2020-06-30 22:41 ` Alex Elder
2020-06-30 22:49 ` David Miller
2020-06-29 21:49 ` [PATCH net-next 2/5] net: ipa: metadata_mask register is " Alex Elder
2020-06-29 21:49 ` [PATCH net-next 3/5] net: ipa: mode register is TX only Alex Elder
2020-06-29 21:49 ` [PATCH net-next 4/5] net: ipa: clarify endpoint register macro constraints Alex Elder
2020-06-29 21:49 ` [PATCH net-next 5/5] net: ipa: HOL_BLOCK_EN_FMASK is a 1-bit mask Alex Elder
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=20200629.180305.1550276438848153234.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bjorn.andersson@linaro.org \
--cc=cpratapa@codeaurora.org \
--cc=elder@linaro.org \
--cc=evgreen@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.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).