lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 29 Jun 2020 18:03:05 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     elder@...aro.org
Cc:     kuba@...nel.org, evgreen@...omium.org, subashab@...eaurora.org,
        cpratapa@...eaurora.org, bjorn.andersson@...aro.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/5] net: ipa: head-of-line block registers
 are RX only

From: Alex Elder <elder@...aro.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@...aro.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().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ