Received: by 10.192.165.148 with SMTP id m20csp3654741imm; Mon, 30 Apr 2018 04:13:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo9+7RjOpNXvRgvChchC2CfBOnxZlxymbqTpvK86fS6kLW441pOFHyy0DXAUFtln4uWR7JB X-Received: by 2002:a17:902:aa94:: with SMTP id d20-v6mr12398052plr.323.1525086795104; Mon, 30 Apr 2018 04:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525086795; cv=none; d=google.com; s=arc-20160816; b=EkxDv+gPRqMdxX8FRTZJuWI/mgaUkWpgO+T0oZbcln+tjYK/H6oxWE1Y93lYVSxj1J GQL9/NCtnhhfBsTfDmtoUD6ap8KyCaMO/QehWFHzxSkgkZMLLBjbAjhiux1W44j7rJfg aApKoEJBjd0OGTfGhFGMlXa+LgNBkUmPkEAFGqE5DJ74mpQNoxu99d/Dj85FlV/vb6oH 727Fn0MNrMa7IwArtKJ95wubeRzePFX0keWZdG5SCQJnANHxGmfiulXW3ornRq+aOmV/ qg2bY3GK5VOb46ttTz0MlryeUzFTsUW8VVJz7DCrGdEmSlkMNpgMArQxep1dCIrZFiUZ itdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=zYHdH6IQvqIMOoi9gmyAfyNX74zxuwa7GTCWhTLZ75k=; b=M41uVOXlr6dO/TSFLxVPfl0Vhm1vrIN/TbcB/FMwC7kxCRasC02xKKG4OYy+WBUq10 ZNtRYgNbNRKIEuJHfc/JqzkrILf7AOM5t6lx7tssDpRBrE54EI0xGm2rtf2exuxFoY/T i2POBUmac29YcC45oJ2X3cc2AV+PZXgP6yagHcxwVjQ2vFs5Rc+YrCuwm/N5wvJpcfYn KAKDhU20Y3h0Q2cpTwY7brhuGCho5Px2Zv/yo+PbXXfFQI5xaKmLB2MCBKyj7vrX30Cx fXmGac63YcsOV6ZaP0PuV54VJrHdWcktCCH2fOdF4ZMStGpnkptAsPLj1JnvM5MNNuhT YPpg== 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 v8-v6si7282534plo.306.2018.04.30.04.12.59; Mon, 30 Apr 2018 04:13:15 -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 S1752080AbeD3LMu (ORCPT + 99 others); Mon, 30 Apr 2018 07:12:50 -0400 Received: from mga03.intel.com ([134.134.136.65]:5810 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbeD3LMt (ORCPT ); Mon, 30 Apr 2018 07:12:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2018 04:12:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,346,1520924400"; d="scan'208";a="195508487" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 30 Apr 2018 04:12:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 08FB2A1; Mon, 30 Apr 2018 14:12:45 +0300 (EEST) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , Mika Westerberg Subject: [PATCH v2] thunderbolt: Handle NULL boot ACL entries properly Date: Mon, 30 Apr 2018 14:12:45 +0300 Message-Id: <20180430111245.31072-1-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the boot ACL entry is already NULL we should not fill in the upper two DWs with 0xfffffffff. Otherwise they are not shown as empty entries when the sysfs attribute is read. Fixes: 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL") Signed-off-by: Mika Westerberg --- Changes from v1 (https://lkml.org/lkml/2018/4/27/845): * Use || instead of && to make sure UUIDs with only one zero DW are still treated as valid. drivers/thunderbolt/icm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index 2d2ceda9aa26..500911f16498 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids) /* Map empty entries to null UUID */ uuid[0] = 0; uuid[1] = 0; - } else { + } else if (uuid[0] != 0 || uuid[1] != 0) { /* Upper two DWs are always one's */ uuid[2] = 0xffffffff; uuid[3] = 0xffffffff; -- 2.17.0