Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4010392imm; Mon, 18 Jun 2018 07:46:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIQTFUVFkwh368Do6QmcoLkDdg0ZSI58U4erWes4qjwJa6osKoAPbx+VyuyHbF77DvFgzof X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr14473691pld.29.1529333180132; Mon, 18 Jun 2018 07:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529333180; cv=none; d=google.com; s=arc-20160816; b=NJPtRKpHz2wM9CJD5Z77m1KPfFu9JbK90zgJf0SpT2EDpGes+8nxsSFHf32+7Qd2aZ LrEZJeCJQJvL0U+sv8l0lvNp6DeFb/P/e7V77xNlFe0Oxr9VO9dEozvF+fbaceZD+Gja 6qf6/goufB5Lfeaax2GEWDrJ4r7PQBRCd/fBphgjIZ4GjHPe4ATGFDCDqvIl6ZEyJ4aJ 5q85koQRQkulh0pz/tvWeWzjKJZ5zsoRpHrIJmRcgHyvexkNdsyfuCsAhTHFeBOG9WWY /n2DEWh7NAb2Lvj3ffi9+BGog9I53ngZr6EhsoYEHEG9nBkCXe6H3KA6KKLWKUfgPRmD HXsA== 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=OedlAGwEuSybplgzed41Df8qBjGtLy7mYqYQ+IX15pg=; b=VWNo7m7QkonKMe+RYSUQuPczPY3A0Xa6fzgRivGM7gOrcSdjUtpITiPt+HHsSQry1u 4NhmeBZcOHRBnBz4WrVHTqVKkKncY/TnbNnqmmgapv41Y2roLOZoIE7KIOTi0wvuVEQ/ x69vD7ZfZCRPJ8pU90os8exZnLuPpvOCR8Tf03G/HEenSxO2e96kzoy7JJhF9FY5Ti6O AYB1NE573BTrd0x4NM2UiFLOrq+mmw+6V0Baml9E0wqRH0GQWoWAeiUt2dpAK/fzWH0S F3buJTDT8IBmLKBls0/2BucBUa62DgILjBrfNGGOd4ZU2EtpxHxlTEIR059QnoPuNGWU xbLw== 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 d184-v6si12295136pgc.577.2018.06.18.07.46.05; Mon, 18 Jun 2018 07:46:20 -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 S935156AbeFROoH (ORCPT + 99 others); Mon, 18 Jun 2018 10:44:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:52544 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934109AbeFROoG (ORCPT ); Mon, 18 Jun 2018 10:44:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 07:44:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,239,1526367600"; d="scan'208";a="65517694" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 18 Jun 2018 07:44:04 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 2AF6EFA; Mon, 18 Jun 2018 17:44:04 +0300 (EEST) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , Christian Kellner , Mario Limonciello , Lukas Wunner , Mika Westerberg Subject: [PATCH] thunderbolt: Notify userspace when boot_acl is changed Date: Mon, 18 Jun 2018 17:44:04 +0300 Message-Id: <20180618144404.21055-1-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL") introduced boot_acl attribute but missed the fact that now userspace needs to poll the attribute constantly to find out whether it has changed or not. Fix this by sending notification to the userspace whenever the boot_acl attribute is changed. Fixes: 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL") Reported-by: Christian Kellner Signed-off-by: Mika Westerberg --- drivers/thunderbolt/domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 6281266b8ec0..a923ebdeb73c 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -213,6 +213,10 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr, goto err_free_acl; } ret = tb->cm_ops->set_boot_acl(tb, acl, tb->nboot_acl); + if (!ret) { + /* Notify userspace about the change */ + kobject_uevent(&tb->dev.kobj, KOBJ_CHANGE); + } mutex_unlock(&tb->lock); err_free_acl: -- 2.17.1