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: Fri, 17 May 2024 11:32:45 -0700
From: Chris Lew <quic_clew@...cinc.com>
To: Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
        Bjorn Andersson
	<andersson@...nel.org>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Peter
 Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
        Will Deacon
	<will@...nel.org>, Waiman Long <longman@...hat.com>,
        Boqun Feng
	<boqun.feng@...il.com>, Jonathan Corbet <corbet@....net>,
        Mathieu Poirier
	<mathieu.poirier@...aro.org>,
        Rob Herring <robh@...nel.org>,
        Krzysztof
 Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
        Konrad Dybcio
	<konrad.dybcio@...aro.org>
CC: <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-doc@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <devicetree@...r.kernel.org>, Richard Maina <quic_rmaina@...cinc.com>
Subject: Re: [PATCH 1/7] hwspinlock: Introduce refcount



On 5/17/2024 1:58 AM, Bryan O'Donoghue wrote:
> On 17/05/2024 00:58, Chris Lew wrote:
>> +    unsigned int refcnt;
> 
> Why int and not refcount_t ?
> 
> Have you an argument for or against use of one over another ?
> 

I wanted to avoid the warning if you try to do a refcount_inc on 0. In 
this case, 0 means the the hwlock is unused but the hwlock should 
persist while waiting for another request. It seemed like refcount_t 
expected the associated object to be released once the count hit 0.

Also the count here is serialized by hwspinlock_tree_lock so the need 
for the atomicity provided by refcount_t was unneeded. Using unsigned 
int here seemed simpler.

> ---
> bod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ