Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4084970imm; Mon, 18 Jun 2018 08:55:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLFjlhqTZ0cQ5AHzffUcl74j+wMyNf6otSbF8Qc5bxgfvK7b2qqtxTvbiLk0fekMGUT3yvo X-Received: by 2002:a17:902:8d8b:: with SMTP id v11-v6mr14928999plo.20.1529337317045; Mon, 18 Jun 2018 08:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529337317; cv=none; d=google.com; s=arc-20160816; b=1JfcC18rglVZHTtwMrP4+1cl8i651QwruvSAOl7yBpVjVncy4shfZOdfoWQOqw9Iil doms+22DmgUsCZMRfoOa4e+B/SNxq2mfzpnQE+Jtha2BiQnotAixuFptheJTFBYWufyK 22xBPt4w1jlUjkLLO16rTYTZz1ZPphIn+rxBvsYyEo66jiYauoWLuzAqP0fsqvXO4tNg 5iV+46Kec2MIheKxQLPMC3jlQwfhKz/lUIgv+YsctpvTojE8pW1ACCfZYP772lTebqCK piQzT6yJQFTI8Q0ck2ubo8yotwXrCdR6XoesQ8AaKSuZMc6bQpyDuJAoA41/iYyyChgn PHSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=kR64JuxiPEqajCbq3a4ZRhr/5YNhAG40WQeOAJ8mYCM=; b=h4L6Nijpiiyy6BS1DeI0RvdVqd+QPGOPbQuyVZmTWe89BcX52+B0zpKhZOs+cAz8Wj RF+UIXYWoojuzDlrh8wnaOCk4nS34n29nuRGbtPgKMQkQrd1tCqnFNZi9nCNLFO4hNRA 3puFX5lB9HEGYgEjrpwzHu0bb51cqA2157FY7GbEHPjHhKsav/Gy8cSR44Eggvk3S2qy 5gpvEadyKkMyQ3inydhnSnWnkgiCcIA0vU5BnrbSAIrTs9E2dj/BQ0AtW7yfqH7xMuc+ qqBUUpuhdLPGfOsO/a5ID+L1gQUbbxR42uH3mTI3Vv16zMXiaKEvOp2wQPndTzZ/jZeE v41w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WADP2CkM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6-v6si15484541plo.508.2018.06.18.08.55.03; Mon, 18 Jun 2018 08:55:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WADP2CkM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755285AbeFRPyU (ORCPT + 99 others); Mon, 18 Jun 2018 11:54:20 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:39320 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbeFRPyR (ORCPT ); Mon, 18 Jun 2018 11:54:17 -0400 Received: by mail-io0-f195.google.com with SMTP id f1-v6so17270951ioh.6 for ; Mon, 18 Jun 2018 08:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kR64JuxiPEqajCbq3a4ZRhr/5YNhAG40WQeOAJ8mYCM=; b=WADP2CkMzJso99qu+Zo6l1oZogru9Lj2VViwmkxAdWwxeZqMwc0zxWazyI/f3BmN6O 89m25cSIM7PUmHIQkBHq8sktGqATQf74joHB25imU/hLYG1CZjwGFJRZIkfQQ28Ob407 I0EYF0daxjgOyVaAWT3nS7PCL0ggs0ODgXzJKPeagRPdwlPwCS+vR+kQTqyTtHm+UvEv fHmLgRGpoABTDIxeocOvkzq1V1gS1DTLKsPNQOsDCkbCQXqSUPmWOXZVmHHo05eD9qGv wmqL4CKk3dE+egZ4AN9+E0WCiBQwIsmK5PFbylPbwJKeikYhJPVFxOUtu556GvpOpcB/ JxEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kR64JuxiPEqajCbq3a4ZRhr/5YNhAG40WQeOAJ8mYCM=; b=A5a97MLmakt8I2gBTLJHDEKNrFFV7GCjQYHOM5XDcOY0gs0GhuBGXFJUY4TJXhr3Ov f9PfjxQC0oSoMNtKGBysePq6ewbvcM2seD+hEwHgq34iADzRv6BeNyOOtGc3eV/juyRe P7hu/jrxtorfiRMmCEVyQ0xXg0upfaEn4IB42r1Y3TdYKzAetAZXALoHG6rF+qzq5/g8 N5LqW8fEpgzdnv0SogxdOFx+qLV+1t5sDufPpe1xtA8ySW158VDqVO/09VpLJR1YqmVc mCasfoxXiqbe8EHP4KHdt7NMwWOHhXV7rC4jnGS0i2APDBP4gynt05JEVPP3bf4aaZZL ysnA== X-Gm-Message-State: APt69E2iCMY2eriMSlN5OeWonrnaap1763BE7Aw+zawUNTMaCCOZqhhq yar5lljA92RzPfsSZIgSCbaq1eAEl3iAmXE1mKZmzVGJ X-Received: by 2002:a6b:88aa:: with SMTP id s42-v6mr10430422ioi.146.1529337257365; Mon, 18 Jun 2018 08:54:17 -0700 (PDT) MIME-Version: 1.0 References: <20180618144404.21055-1-mika.westerberg@linux.intel.com> In-Reply-To: <20180618144404.21055-1-mika.westerberg@linux.intel.com> From: Yehezkel Bernat Date: Mon, 18 Jun 2018 18:54:00 +0300 Message-ID: Subject: Re: [PATCH] thunderbolt: Notify userspace when boot_acl is changed To: Mika Westerberg Cc: LKML , Andreas Noever , michael.jamet@intel.com, christian@kellner.me, Mario Limonciello , lukas@wunner.de Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 18, 2018 at 5:44 PM Mika Westerberg wrote: > > 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 > Acked-by: Yehezkel Bernat