Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1224189ybl; Tue, 13 Aug 2019 09:12:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX62qGRp6o7XlbJbXN88ZR27zPydOFagw9uFqHc5Y+BIkP3lOqswI7Z3uYsT4ti7s5ah3z X-Received: by 2002:a17:90a:9ea:: with SMTP id 97mr2856685pjo.68.1565712759842; Tue, 13 Aug 2019 09:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565712759; cv=none; d=google.com; s=arc-20160816; b=MFxgumH150ZitXuSb6nOkCi18esd6ks5mHB9Oh8fFSMFcxMtHjsXswbExQDjFRBl+K sCStsfJ8dc8llHqVk7oGNr1LN8yZjAMEMMluQS9tYz/WkMUwD+STKDCSEw6e0iJsjZs3 xTjsQHVNcOy3gtpOgEruCFW0KSwd+71UhwiH1czEPea2JntEbhzRUvDcCYKKFl/Ma9yq qs4/1/pI6fK8UZGOqHukKqKWulqnDzjCU4dmtip7DWu3KC2ARVVEeSwk9QOruzyaZHYZ S5Db6hSc4LACpg7HfegNKvc4hhGHstYpv0yukscJtZM8D6uWX7ozHqvfPYsEBc2Glc8p K+KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HBVkukrvnRw2VtO13xEDOxwDahtERGEtX7w+pID80Yo=; b=WMhRcMm9lmHQuGh3olRHcfq9wrFNOtVXF5BUwRypGMUx4G9SlJ1GNOJVmlJMur8QY0 F/F3sMz5KbNEM+E+1Q2T5vnXsyJOs4SiYhA7x+4R7uyY/bBt5kQ8h+AOezEszctaF/YJ amYjI3HoMeH/42dAdRllMdtGE211UCiN1WzY2eloxEMEin1AJM+Y6e+HBxamQs6yhtIP AIy8XNn6wijkfkQic58g9PbLdRHym7te35phrJWliD6i75dBT9Uuguu2+MVSVxTxy/IH GpfZkFjkVqJ2tse8/m8Ufzxs7VH66jhPMMEqNryBLAx92T4RGGLZveA5yB39MVHWKFIO V2XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h186si67093550pge.110.2019.08.13.09.12.24; Tue, 13 Aug 2019 09:12:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbfHMQKl (ORCPT + 99 others); Tue, 13 Aug 2019 12:10:41 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:47169 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfHMQKl (ORCPT ); Tue, 13 Aug 2019 12:10:41 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id EDF5C102F35CC; Tue, 13 Aug 2019 18:10:38 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id B05271359A; Tue, 13 Aug 2019 18:10:38 +0200 (CEST) Date: Tue, 13 Aug 2019 18:10:38 +0200 From: Lukas Wunner To: Mika Westerberg Cc: linux-kernel@vger.kernel.org, Andreas Noever , Michael Jamet , Yehezkel Bernat , "Rafael J. Wysocki" , Len Brown , Mario.Limonciello@dell.com, Anthony Wong , Rajmohan Mani , Raanan Avargil , David Laight , linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 7/8] thunderbolt: Add support for Intel Ice Lake Message-ID: <20190813161038.tip2u2z22xqnmfjl@wunner.de> References: <20190812123847.50802-1-mika.westerberg@linux.intel.com> <20190812123847.50802-8-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190812123847.50802-8-mika.westerberg@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 12, 2019 at 03:38:46PM +0300, Mika Westerberg wrote: > +static void icm_veto_begin(struct tb *tb) > +{ > + struct icm *icm = tb_priv(tb); > + > + if (!icm->veto) { > + icm->veto = true; > + /* Keep the domain powered while veto is in effect */ > + pm_runtime_get(&tb->dev); > + } > +} Hm, don't you need memory barriers when accessing icm->veto? If so, I'd suggest: /* Keep the domain powered while veto is in effect */ if (cmpxchg(&icm->veto, false, true)) pm_runtime_get(&tb->dev); You'll have to declare icm->veto unsigned int instead of bool because thunderbolt.ko is compiled if CONFIG_COMPILE_TEST is enabled and there are arches which do not support cmpxchg for a size of 1 byte. The other bools in struct icm should likewise be unsigned int per Linus' dictum: https://lkml.org/lkml/2017/11/21/384 > --- a/drivers/thunderbolt/nhi.c > +++ b/drivers/thunderbolt/nhi.c > +/* Ice Lake specific NHI operations */ > + Again, can't this be moved to a separate file for maintainability? Thanks, Lukas