Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp493454lqd; Wed, 24 Apr 2024 08:21:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV+cgOPlMYZPg5farzv9IKRkqOdgLkNtduh98EqCovsX38eTsIUBBbXC0S+INWBeFQXo50uf8Z+DvbUKHbo04op7t5m1rDNVVXK1vQBkw== X-Google-Smtp-Source: AGHT+IHPVPPjiBE3Yqp40jUXhJsjl/4p4I3c0cZiHXRfohrK2JshQB+TTJL0EyZyTDpiNP0LkTfZ X-Received: by 2002:a05:620a:4002:b0:78d:42d8:7123 with SMTP id h2-20020a05620a400200b0078d42d87123mr10437653qko.21.1713972112670; Wed, 24 Apr 2024 08:21:52 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ye19-20020a05620a3b9300b007907837a693si6649810qkn.338.2024.04.24.08.21.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=PzcVnCJQ; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-157184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2392A1C25168 for ; Wed, 24 Apr 2024 15:21:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CF1816130D; Wed, 24 Apr 2024 15:21:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PzcVnCJQ" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C140E15E5CC; Wed, 24 Apr 2024 15:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713972081; cv=none; b=XJVjvA7WVLJJLPVaVHZypejNvVrs5FEl9OqTnuZ6vm/6NmjGHr26QoXSKY6xoP4JinTQRufRjnImZnTsH1fZuPw9c7FhuBFbDe/z+jS39LVVpRiGh58xsDJawheQnXb6ncuuusd28bq4S72RAxSMeLZ80U5eXVnkgCwK1sMv2eA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713972081; c=relaxed/simple; bh=die5GEdR93SZJIrj+6mbvz6RS0d1bUoi/TXLw5RP8dI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Content-Type; b=K5+nVxqiPT/AU8ow28gJ2Id69QLVwshDhULOHMhHfQnuexEENCDRAJX5V5EOF20PTOJwactcqZsqoD72p/W0UeO/gBK1P3Kc36Eu0TFG6YciTF1uUOQwvpjlTCyS5UeQliXiHEWyPoFYMJumAGJbL+zMKv+JWT7kqYUJdqEZIJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PzcVnCJQ; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a5544fd07easo68366b.0; Wed, 24 Apr 2024 08:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713972078; x=1714576878; darn=vger.kernel.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Xmbep3Wj2edBDGZAic+hg2xj7nE0C73pjSQNpMAXt4k=; b=PzcVnCJQAvQA2+mMxauGIo/XWcsm2/lUw9jHxK04kGnPaFPao/T/FX3ABVeiSfuxfc MHN1rl/bVzfvAbe4YcsatEpeHggf/ZlXEFW0jnNHu1ltvYApUUf+eSZV5N+gb28/rZAp nRoyotu5LkjRvYj7fm/iDul68jbEaAKgVs1oYGrZKCbYkByvmDLnd0Q2lkfcyHeVrNdy JMnR6BiL6Jj+Zgf071z1c5CGIrlboSFCTxFEDFmy5SivkDJC3rsojQJy+cCD+0OoBPdE CtGrUHd+HijWBvaFcGbCV+CFFxS///qpFBgLmUykhLpkDNR7Z2DGbEdxHPdIyB/lZOvL 6KdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713972078; x=1714576878; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xmbep3Wj2edBDGZAic+hg2xj7nE0C73pjSQNpMAXt4k=; b=APm3X8J+xn9KNMRrot3OCMRniImNGxsMjQ6eVpwWPGrOWeJMERm5oIBS0BrTUy/wnC iDVt56oIgPUv8R/Ne7XQCwGN+Yi9S7ZqkZfwu7lLJAz9/msU22sbSActxTeb+PfqBzjJ Ya8knfcm5TK1+S1BFn8ORacv2iEEU9IdJ2pgqzc2igGUiBsmeZVrwEwTP4U2nCBDm4DF DaDYL2G4MPC3vClOybFjbeBO1p3y1yQ6QVf09cbDR8h6F0CriKWM6JTNbvB9JSl69vlZ QpfSoMV+5JRot6MUGi1tgmInsCQsA/kCJY7ACTuZklukcFPTtJXOfX2Jc48CAPGfph1R PEnw== X-Forwarded-Encrypted: i=1; AJvYcCVD6nZuGLylKNp+Y+2beVV9s7YCIg+aFV2QPnQyAkUj1vh3LdVaTyh5uTZ1GUyS7EuoxtcVgJTOXizE7ANN1LOP6hYHa9hr9SRaDHdXOB12Ao/rsEkmG+x5tLooWvpeV0OZ3g7OEYrEFDJc85TdIBSm5Qd3tRCueVg+zcRQWtX9y4NJBd3IZtkGaO0Tn222wgsnce7rrQl5cVwNbfTZep/J X-Gm-Message-State: AOJu0YxPup5VvkeYN0hcwo/+K6Tb5uOdBS+f3aDa4uBBzYT/LDbWI3Y9 Vf9jGvcLhfS9L2R17iQoSq1Fad9Jrsi49Bq+loZnJQ5fPsyuZel/yQnFIKUDmjSkvlSA2wBhJLV 79G1Z1g+bU1KLDuNwOZhjqiyXhTQ= X-Received: by 2002:a17:906:308c:b0:a51:8d60:215a with SMTP id 12-20020a170906308c00b00a518d60215amr1836143ejv.27.1713972077907; Wed, 24 Apr 2024 08:21:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240423223309.1468198-2-aren@peacevolution.org> <20240423223309.1468198-4-aren@peacevolution.org> <5qqil7ltqhdeabml6toqpcy773uhjxgwaz3txpy4kv4sz55o2y@hmar674eey7s> In-Reply-To: <5qqil7ltqhdeabml6toqpcy773uhjxgwaz3txpy4kv4sz55o2y@hmar674eey7s> From: Andy Shevchenko Date: Wed, 24 Apr 2024 18:20:41 +0300 Message-ID: Subject: Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend To: =?UTF-8?Q?Ond=C5=99ej_Jirman?= , Andy Shevchenko , Aren Moynihan , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , linux-iio@vger.kernel.org, phone-devel@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Willow Barraco Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2024 at 3:59=E2=80=AFPM Ond=C5=99ej Jirman wr= ote: > On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote: > > On Wed, Apr 24, 2024 at 1:41=E2=80=AFAM Aren Moynihan wrote: .. > > > ret =3D stk3310_init(indio_dev); > > > if (ret < 0) > > > - return ret; > > > + goto err_vdd_disable; > > > > This is wrong. You will have the regulator being disabled _before_ > > IRQ. Note, that the original code likely has a bug which sets states > > before disabling IRQ and removing a handler. > > How so? stk3310_init is called before enabling the interrupt. Exactly, IRQ is registered with devm and hence the error path and remove stages will got it in a wrong order. > Original code has a bug that IRQ is enabled before registering the > IIO device, Indeed, but this is another bug. > so if IRQ is triggered before registration, iio_push_event > from IRQ handler may be called on a not yet registered IIO device. > > Never saw it happen, though. :) Because nobody cares enough to enable DEBUG_SHIRQ. --=20 With Best Regards, Andy Shevchenko