Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp942655pxb; Mon, 16 Aug 2021 23:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8n3cgdZynWwWnyzkykulm5yGeEIu9hOIcel7cJB75BSComMw2vofZcjngkOVeum1Xipj3 X-Received: by 2002:a02:866b:: with SMTP id e98mr1596573jai.48.1629181155334; Mon, 16 Aug 2021 23:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629181155; cv=none; d=google.com; s=arc-20160816; b=L+ENg8jkeoewgb3Y+td7gJ6EzyrJFeQtaLU/lFwEwSumm3EtLYmM9Hga8J7QJBI3y6 h+lOX44L1Uv81upaewk3rMi62XJR1bajWepgDgywrC9tE6a+jiIzSvGAm14pqL/ImMlO WLJPqxok0kcK/gtp2EN+3xIzbBgX9P+u1VxDRqgkWr/7WtCCbAs8sNdZyEVFeSOJ2nVf KF0T869Q46zwImxW8vHhWagCCcdxV8fS4WhwqfdxXHx/g5HREsV/toaqNGdD2JRP15/1 G1udKcJIpAvbOIdSUmA09GnhxhpMepz+6zw8EDMvBxSsj52mMo4eZHVwuml+Jy3eKORp gaUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LZJAGR1WyjyArrVWmYMYXGcGz885PHdRW+PqKe5e+TY=; b=RDhl0qTYfdJe/O959m0vBZGJRN9Gz096Gwi/Jv8DxFzKKuEGwRfaS56fGP3iLV7Wbh BPuZfc9KFebXBnCBIzlhUoKpc9vf2saZmxy/EkGhKaeWMe2YQzxbBpkiw/cM8ZqDQrMS wsM3Dgex8dtlrREsmtkq6UbRmwKEjcKbU0YLxFyX5e4WmnxdU90SPi0WCiQWqwuKYmN8 OnjEvZSspMl+Hq2PpyKY3gW0A6GPUD0zOkOD8Vtc1yQeoGIALRJpG6g9CuHG4KoIjkes yR2X/cMoBx5dr+l+kUJgAIM+rJ1npQ8NXwl0SjuTRAa0sx5wU7BAJZnX0jK7KwUMSFfK 3w1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=DFi3kcXi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si1417111ilg.98.2021.08.16.23.19.03; Mon, 16 Aug 2021 23:19:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=DFi3kcXi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234233AbhHQGSz (ORCPT + 99 others); Tue, 17 Aug 2021 02:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233676AbhHQGSy (ORCPT ); Tue, 17 Aug 2021 02:18:54 -0400 Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA5D6C061764 for ; Mon, 16 Aug 2021 23:18:21 -0700 (PDT) Received: by mail-ua1-x92d.google.com with SMTP id t26so8576834uao.12 for ; Mon, 16 Aug 2021 23:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LZJAGR1WyjyArrVWmYMYXGcGz885PHdRW+PqKe5e+TY=; b=DFi3kcXi+PvWxJzssbjlLt8bwPhtsnGimjnjW35mdQFk1T3ngzjDgdjAXPUb3CJDOp 11+x9sD5FZyYf5DZM+SpviBaCeWRcFZ6dpWcRsFf3FedSUunv7cKkfZY6XDYuqFwN8gi LzDl5I5thKB6s8IB5uCX01Hp7Pp86Nng/ggOi4J+8QFd+TIKuQCBzLI+CGMBmailR8I8 iVRNOZ6MtgaSe1XobiSU8R1RvATrFWPzVaeHaPgUF/joDNjBHBrAsjcZjz2OdTunWynG 5YsS378P7wIkaNN1Ypmj8XgLN8+kBMRAc1nvVVv59Ysb+W6Gvu2tYEtvDnuOu0bBjNv/ ulYA== 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=LZJAGR1WyjyArrVWmYMYXGcGz885PHdRW+PqKe5e+TY=; b=SFcetRf+IIG5gTUpy2RlmSbizdDv+ViDPej0kKH0II+1EGisb+yHBhEFSeMyjVpYHI 5Y45cq6BpCEf3l9Ms6VVIPJe9x53uFKp6/blrQfS8IM4iP0CeUMe+wLXWAYkWoeXMBEl eKRrXLhr1mGtnuxmworn2+f/+t7tKFJpIXWbeQDH8EfPDb5Ului3f6AAaQTKSSG1NTkl IuAtueu13w5q73zLSwHhfIJlcOKyLMmiKO5DMSKHwsHAg+7gYkq0fBjjmDUbEASLcjfW DPsbVdaH3gd4tCjFwVkziTVSd1bJwR8WIrJ4usQSdnNOkmy1P4upM+/uvCtpV+XUVaC0 UVig== X-Gm-Message-State: AOAM531cYwSsDE9aJeE6slvAhlgl3SdiNYipNdOL/KQEDi4qUer3CE7/ pwLja2884n4pu7bAybSe5GATgLljuRCkCRqmAqPzng== X-Received: by 2002:a9f:2d88:: with SMTP id v8mr917275uaj.50.1629181101095; Mon, 16 Aug 2021 23:18:21 -0700 (PDT) MIME-Version: 1.0 References: <20210816082836.67511-1-aardelean@deviqon.com> <20210816082836.67511-2-aardelean@deviqon.com> In-Reply-To: From: Alexandru Ardelean Date: Tue, 17 Aug 2021 09:18:10 +0300 Message-ID: Subject: Re: [PATCH v2 1/5] iio: st_sensors: disable regulators after device unregistration To: Linus Walleij Cc: linux-iio , linux-kernel , Denis CIOCCA , Jonathan Cameron , Lee Jones , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Aug 2021 at 01:50, Linus Walleij wrote: > > On Mon, Aug 16, 2021 at 10:30 AM Alexandru Ardelean > wrote: > > > Up until commit ea7e586bdd331 ("iio: st_sensors: move regulator retrieveal > > to core") only the ST pressure driver seems to have had any regulator > > disable. After that commit, the regulator handling was moved into the > > common st_sensors logic. > > > > In all instances of this regulator handling, the regulators were disabled > > before unregistering the IIO device. > > This can cause issues where the device would be powered down and still be > > available to userspace, allowing it to send invalid/garbage data. > > > > This change moves the st_sensors_power_disable() after the common probe > > functions. These common probe functions also handle unregistering the IIO > > device. > > > > Fixes: 774487611c949 ("iio: pressure-core: st: Provide support for the Vdd power supply") > > Fixes: ea7e586bdd331 ("iio: st_sensors: move regulator retrieveal to core") > > Cc: Lee Jones > > Cc: Denis CIOCCA > > Cc: Linus Walleij > > Cc: Andy Shevchenko > > Signed-off-by: Alexandru Ardelean > > That's a valid concern I suppose: > Reviewed-by: Linus Walleij > > But as it now occurs last before return 0, can't we just solve > this with a > devm_add_action_or_reset(dev, st_sensors_power_off_action, *); > of some kind and let devres handle it? i think this is my fault for not CC-ing the entire series to you: https://patchwork.kernel.org/project/linux-iio/list/?series=531879 this is part of a larger conversion to devm_ for ST sensors; i was hoping that if i CC you on one patch, then git send-email would CC you on the entire set; doesn't seem to be the case; i'll try to remember that on the next sets; [but maybe having this written here, will help me remember] > > c.f > drivers/input/touchscreen/cy8ctma140.c > > Yours, > Linus Walleij