Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp561783pxk; Wed, 23 Sep 2020 09:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlzcAQX0mck0efbGVxGXddm2KbHre6CWp0w63pSC/Hr3j/v/tjne/FzCehF8LFmlrySTrf X-Received: by 2002:a17:906:5046:: with SMTP id e6mr563545ejk.449.1600880334978; Wed, 23 Sep 2020 09:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600880334; cv=none; d=google.com; s=arc-20160816; b=MxL3y9NZD6lgHHmWt112G3fusgCgfeBahar5W/fJeB/MZnF7nnsfkLhLyl6gKHSnhq tTR7q/oZINFBcJwrQPMy8jTUKY69GXZzuD2S9d4HkBOOBDI9UikSDFc7CBb2bd5qiSDQ FvQII8ohQ5NywljZw1oNY3JApdtM3kUaaAfC0jQp7lAuOHQcoNx5bkAPahhfQ6W0fcfd WtEGvXOT338XJOiZZUpjpFzBRzHut0lwKdmZm2ANbm8PtS5RUugSXqEb+X+fyLU72Q9d UV4bInX0aDlYN0gIy86CRtQuQd77l84J/5uNViBIn8C9t8ahFc8Dq0BAEYlrBEc0M7RV E8RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I1DPR9CqmON01vDk/jDEvQfanuiihiKSVogwn9R/u34=; b=0+bic3CkaQl1wF6qavP+cL+C69e1+csMFikN+LsuBV/l5yactk9i1j+kXjm0ncp8XM 1miJbLjGJETYoqKWjEdwWu7H/pxX211U52mRDsqvhw3+mjN4I2l+FK6zDpJ/hn5KWYlT d9UNNjRUJcsN/4JzrQosIGj0VzF+J6arWqoI4RscKFS/ItUmLuH0YDzDqX5OcRy86IEH 9yMCJd0D91oC7z2srY4xyWpMLCcNehdzRkU0f6REJ8A+PlcHHsjCHO4VpI+od2s3IR+s iezzNujApF2Aa+VoCfIxZ+/R56JJ4Lp1YCqaJO7Gx/yYBicG6Xr6LsObFKcD1nxv/Ib5 /u8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=frkDKHFk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv24si331371ejb.258.2020.09.23.09.58.30; Wed, 23 Sep 2020 09:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=frkDKHFk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbgIWQ51 (ORCPT + 99 others); Wed, 23 Sep 2020 12:57:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:60002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbgIWQ51 (ORCPT ); Wed, 23 Sep 2020 12:57:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A69220BED; Wed, 23 Sep 2020 16:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600880246; bh=hIdSVVLt2zl1VTm4xEiFNczxwYeQMbtR2OaGzJVMESg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=frkDKHFkw1LNkAk9Hk3XL4hZDLPoU7jUkLN8nuMM/AI1vuMKuzNC7Da4YfuapGy2O YHbtU7iCnrKFKaOzIysY3MfXEa4SD7bpvWbFjFHMCCr0WNUH5JvTWFvBprbc60YTF9 il8QBspfZvtbkFHbFCnfLuAnmXo4hcGQEtrDiY1E= Date: Wed, 23 Sep 2020 18:57:45 +0200 From: Greg Kroah-Hartman To: Maximilian Luz Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Arnd Bergmann , Rob Herring , Jiri Slaby , =?utf-8?B?Qmxhxb4=?= Hrastnik , Dorian Stoll Subject: Re: [RFC PATCH 1/9] misc: Add Surface Aggregator subsystem Message-ID: <20200923165745.GA3732240@kroah.com> References: <20200923151511.3842150-1-luzmaximilian@gmail.com> <20200923151511.3842150-2-luzmaximilian@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200923151511.3842150-2-luzmaximilian@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 05:15:03PM +0200, Maximilian Luz wrote: > +/* -- Safe counters. -------------------------------------------------------- */ > + > +/** > + * ssh_seq_reset() - Reset/initialize sequence ID counter. > + * @c: The counter to reset. > + */ > +static void ssh_seq_reset(struct ssh_seq_counter *c) > +{ > + WRITE_ONCE(c->value, 0); > +} These "counters" are odd, what exactly are they? They seem like a simple atomic counter, but not quite, so you have rolled your own pseudo-atomic variable. Are you sure that it works properly? If so, how? What about just using an ida/idr structure instead? Or just a simple atomic counter that avoids the values you can't touch, or better yet, a simple number with a correct lock protecting it :) thanks, greg k-h