From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 ECCEC33C1B7 for ; Sat, 27 Jun 2026 17:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782581204; cv=none; b=kbjEpqTCwFJb1BgrdayCtlvI5wiF7XOGTrhgZCChwE5DsyzZ3hS7Jr4vz+PbJbJSbCiufX0uiCWIksufbY3ymOS8v4cUGJc2vaislc5EAaq0XQPO9vkaMq39OhQipYHZNKCNaixkigHqFuFKw72CIfgm5kM+xZnu4W66l75ky/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782581204; c=relaxed/simple; bh=4P+AxRu+aP0P/lZrxKgWWxmE5YAZHis7WqiS/V5axvE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ADCDaSZGU5qkMJNfiQgGYIumSrIKCrevw05flY8l/4x6eavimfF8q+O0jvIyOY+x5X+nzlTsEixNMY3ko/J7FkPzN8ZAGF8d3fYcaK7gGGSizS/Bby5yhkaqugDoiGeM+ZKxl4mByMEwmiu1mm+jXQbKKirgrG0HXSa/yP25SFs= 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=nNflKD2c; arc=none smtp.client-ip=209.85.128.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nNflKD2c" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-492719b2d81so3293165e9.3 for ; Sat, 27 Jun 2026 10:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782581200; x=1783186000; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=QDQP8mnP+Jn71ABEIP8xYOjy07PIL00ezJXXjBMJLS0=; b=nNflKD2cbAh8+nXjj8nFF5N7LBT8EL1im+xl2YmyrdJFtugAIy+fj9OVGZf1JROvQA q8kKMUBuaAZEaqKSlSsRZtUKMNz9qwFqP/tdtzl4T1qZ4ZLFd4+6cQaP6Sbr5XnGBx6N wYBJhK68ob5P3wuWW++AuJfG8WHnqvZyVXs+stbT+aoup7DO2ht6XyPy3NeepiQCTPbR KIAbamcdSGJd3k857v7rV0Vjr7uk1j/4DV0gX6ExjWqa7nIi8vnB7wQL+yQ6VjmqVka1 /RJgs9Xv1z+0Ng+UIuDPoGU9a2BF3QP04stBq1qQsrVEYXDbxkR6vy/ACXOk1skBoTdD P5jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782581200; x=1783186000; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QDQP8mnP+Jn71ABEIP8xYOjy07PIL00ezJXXjBMJLS0=; b=D0hPy+7v0zWq0r2rPQlquZv7GJqgCeKJaglzPP+EY7Njxhzli6UIWc9CTv/t3jFpiY IQsMDnHjml7U3OV2qMl9WU3z5TKKWOF75W+4aUbADAkYo0PWsAhX7DKyBz41/QizrKu9 sswqVGOHfCkj5jfz6aqZrZjFEevjY4ZMA3/rkLI1/SwApbgc2Ph4aMbIog5lwV8JDWn8 YG6D41GBN2xdUM6f+G73+ynO4Mv4wLNC4GOq+bSkuBLU00Rnp8zszAgNi/6Pq8Uk1e15 p66eNkVXxUA6ujyYoJaCuYF/Znu++EZcW9ykHFHcyXTl1H2qPvpqf4MR1Y/wYfkScuBo aL2g== X-Forwarded-Encrypted: i=1; AFNElJ84Pq9JiuxxgdS5h3s8509ZqbF6gAxqpLAdKiU5xDSb1H0y7SfQ3IEUJ4sxl918PZoJ/Uk9s/sXpB7kHCg=@vger.kernel.org X-Gm-Message-State: AOJu0YyV1I5NeZADIF4EQvZX+ecOqqMQtUmnnbgSQLRa6EXugArXTx3h EnrYPrwwzOYknJ9PzYW8Qr6b+Lw0L/N2+VSl0vOpyjlJZYV0s/hFPUOF X-Gm-Gg: AfdE7clK80y/U+Vgda/K/li32Wtc23Zvs7cYpVrgNn2K26f/U5vtgyVmXSLirlmCp6G SpkolsaXKaJA5eKdv+ALdd9g/9/e1H8himX0upHtRYIiJwxYeamlAMmFzEVXkXYiYT8URh7M97P NBHcT/Yr15RXfXO5W8GcCI7fzslRSR2Tg+lfdKx5f6sbov59JxJf0VM8Xd8XreSU0mC+/SdpSYF cfhdbkR3vuk/khgO4qMR6lrErYydhM1zt9+7qiLczVv0oDkFiuvJARuUkEyGvZwm24mP7MQRra5 l71ORweKHeorWydEbLQZLfvjuAndBV6FNwO0i9UK8FV7vG1Awc7tN3UuFQaQgCsFm7gIORmo2Bn rB0Zqkf7z6qli2Lh9ZY7u3lTbhu0m07dttdCEaUPsunkisTrQngL+q+IsrglxffjwKn/WE7Dohl ud6R8utP5f0qmvNqJ0oeg36IRiJ9kvdzeWcwWMmrWAp6RPeJgw1MiC+Nw0g0vGfAy74Wif3jZHo zQjBeCX9fEjC+4fcRNJFPcCnmqENDRrcczofOlvVhuQIOKUSKjlL4wLP24sDOVO62iqfx0/EW3M TDvfdTjHONpqk4bQ X-Received: by 2002:a05:600c:4e0b:b0:490:44eb:c1ea with SMTP id 5b1f17b1804b1-4926fc78e30mr87904095e9.24.1782581200242; Sat, 27 Jun 2026 10:26:40 -0700 (PDT) Received: from systembl0wer ([2a02:8308:4092:11f0::f9f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49269071c9esm170020025e9.9.2026.06.27.10.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2026 10:26:40 -0700 (PDT) Date: Sat, 27 Jun 2026 19:26:38 +0200 From: Joshua Crofts To: Moksh Panicker Cc: jic23@kernel.org, nuno.sa@analog.com, Michael.Hennerich@analog.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, skhan@linuxfoundation.org Subject: Re: [PATCH] iio: adc: ad7779: Initialize completion before requesting IRQ Message-ID: <20260627192638.5623df0e@systembl0wer> In-Reply-To: <20260627112205.31409-1-mokshpanicker.7@gmail.com> References: <20260627112205.31409-1-mokshpanicker.7@gmail.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 27 Jun 2026 11:22:05 +0000 Moksh Panicker wrote: > init_completion() is called after devm_request_irq() in > ad7779_setup_trigger(). If the IRQ fires before init_completion() > runs, the completion is in an undefined state. This is probably impossible, as devm_request_irq() is called with IRQF_NO_AUTOEN as a parameter, therefore IRQs are enabled manually in the code. > Move init_completion() before devm_request_irq() to ensure the > completion is ready before the IRQ handler can signal it. > > Fixes: c9a3f8c7bfcb ("drivers: iio: adc: add support for ad777x family") > Cc: stable@vger.kernel.org > Signed-off-by: Moksh Panicker > --- > drivers/iio/adc/ad7779.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/ad7779.c b/drivers/iio/adc/ad7779.c > index 695cc79e78da..db8f5f4c6d6a 100644 > --- a/drivers/iio/adc/ad7779.c > +++ b/drivers/iio/adc/ad7779.c > @@ -838,6 +838,8 @@ static int ad7779_setup_without_backend(struct ad7779_state *st, struct iio_dev > st->trig->ops = &ad7779_trigger_ops; > > iio_trigger_set_drvdata(st->trig, st); > + init_completion(&st->completion); Is there really any point in having this when st->completion isn't used anywhere in the driver? I'd rather be for removing this function call and the struct completion from struct ad7779_state. > + > > ret = devm_request_irq(dev, st->spi->irq, iio_trigger_generic_data_rdy_poll, > IRQF_NO_THREAD | IRQF_NO_AUTOEN, indio_dev->name, Unrelated, however the dev_err_probe() call below this is unnecessary, as devm_request_irq already returns a dev_err_probe on failure. Consider sending a patch for this as well. -- Kind regards CJD