[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b8610296-f8cf-4b61-9b64-ffb52b7ab251@quicinc.com>
Date: Wed, 12 Jun 2024 17:43:33 +0800
From: quic_zijuhu <quic_zijuhu@...cinc.com>
To: Johannes Berg <johannes@...solutions.net>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<emmanuel.grumbach@...el.com>
CC: <linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH v1 2/2] net: rfkill: Fix a logic error within
rfkill_set_hw_state_reason()
On 6/12/2024 4:18 PM, Johannes Berg wrote:
> On Fri, 2024-06-07 at 22:40 +0800, Zijun Hu wrote:
>> Kernel API rfkill_set_hw_state_reason() wrongly gets previous block state
>> by using its parameter @reason as reason mask.
>
> Using reason as a mask is perfectly valid.
>
> And checking that the bit changed also seems valid.
>
i don't think so as explained below.
let us assume @rfkill->hard_block_reasons has value
RFKILL_HARD_BLOCK_SIGNAL which means block state before
__rfkill_set_sw_state(..., true, RFKILL_HARD_BLOCK_NOT_OWNER) is invoked.
@prev should mean previous block state, @prev will have false based on
current logic, it is wrong since rfkill have block state before the call.
> We might want to not schedule the worker if it's not needed, but that's
> a different issue, I don't see a real bug here?
>
the worker will be unneccessarily scheduled for above example based on
current logic even if the rfkill always stay in block state.
> johannes
>
Powered by blists - more mailing lists