Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1281412ybl; Tue, 13 Aug 2019 10:03:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQjwAEnllrPrKWgaP1S0l+NA6msDhbpt6OIs5/8yfZ5ZJSVc4eSxmPDEZLMzka3usAyJc9 X-Received: by 2002:a17:90a:db0d:: with SMTP id g13mr3147714pjv.51.1565715790058; Tue, 13 Aug 2019 10:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565715790; cv=none; d=google.com; s=arc-20160816; b=UPGHBmfgzZXaCbEvBoFatS4fGdehEjKgT2nKQLHrqsSLABtUU+khU9Rbv/cpnmt/AR K6tGR1rhIm18YJHLSEGP9hizBf/YZbflwcefKkC1BUR3c2d62bJo3nIHDll78Hib1T76 kPnPh1T8ZnUDT1cWYemNar2/vj4UYywUmXZ1NDaxAzX5VTHpR5lolzjqnjkQyr7A9VA0 q3WXmlGu7vRun4MO9GSLwF5Cyg1LD7itHEMs0igErpT71GCc3Ub6btncC+PQ+P70uBs9 Kr8Wr2t6uUKQ/sVbf9e9VaNJ2amq8rHZOaYqrXatfS21/YqZ6tf3Ni6t5D40vlUArDuJ CYzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GoHJW8folXg9d+ljowqy4zlA7oo46+qQCrnjr+viyA0=; b=B9552O49NtruH62Beqvu18VmHw6MN0WkNV5mR6L2UYafGBNcGyHB5Qa2QMgIGHkGmv pLc5EVqAJmjEDb56TH66pnr0yypRptdFf6M7vuk0jsozjYaGZj/U3DIeOPzo34gO1N4s H0ZcF6vYCwWjZBZroI3PiF4D820ZB5D2MA5abOF/I3cnq9Ui9XArJrzgL92REEPi/HH2 ZsKbHc0k4+52ucw9sNkPF+f8lRARjx2v5SxCoMOGq7lpfd0XOajLIFczDcdutG1yMeld lsJQnac0t/ls6pXzYfGReKFv4F/l+dS6nRwPHYPpbNRc6w0Si2MwxnXAjX2EzPJMx+XO LekQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p44si1075437pjp.0.2019.08.13.10.02.53; Tue, 13 Aug 2019 10:03:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbfHMRBP (ORCPT + 99 others); Tue, 13 Aug 2019 13:01:15 -0400 Received: from mga12.intel.com ([192.55.52.136]:24701 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbfHMRBO (ORCPT ); Tue, 13 Aug 2019 13:01:14 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2019 10:01:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,382,1559545200"; d="scan'208";a="194233254" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 13 Aug 2019 10:01:10 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 13 Aug 2019 20:01:09 +0300 Date: Tue, 13 Aug 2019 20:01:09 +0300 From: Mika Westerberg To: Lukas Wunner 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: <20190813170109.GB18281@lahna.fi.intel.com> References: <20190812123847.50802-1-mika.westerberg@linux.intel.com> <20190812123847.50802-8-mika.westerberg@linux.intel.com> <20190813161038.tip2u2z22xqnmfjl@wunner.de> <20190813164930.GA18281@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813164930.GA18281@lahna.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 07:49:35PM +0300, Mika Westerberg wrote: > > 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 > > Yeah, it probably wastes some space but I like them because IMHO they > are more readable than bitfields. We have a bunch of other bools in the > driver structures so if we are going to convert struct icm we should do > the same for others to keep things consistent. Probably should be a > separate cleanup patch. Then again assigning to bool looks more "correct" than with bitfield: icm->veto = false; vs. icm->veto = 0; It is possible to use false/true with bitfield but it does not feel right. Maybe it's just me ;-)