Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4018070rdg; Wed, 18 Oct 2023 12:20:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaeiMzHcTr8jafgRDvXfw3xzjwEAr1Gb6br7kSOFRYSMLKOx5rFPjZ/TJU4zlgTgaDL104 X-Received: by 2002:a05:6830:d0:b0:6c4:ac5b:aaea with SMTP id x16-20020a05683000d000b006c4ac5baaeamr174492oto.25.1697656823662; Wed, 18 Oct 2023 12:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697656823; cv=none; d=google.com; s=arc-20160816; b=tsgHtGbu03aobR1nmf1LS033ZqGwoLARYg2DeMwYIg5RKABeZca/flCNy2qnJ/BfVV TqWpt8xH0AoBGdvLhf0Nfdj7VeJaIOOdubgNXYm47s3J2/iZnTVcvr/d23B83b8VjuCW MPRlnRGlOdkEffwdRgJC4ZYpn2Dxyj6NOcJaxKGqnqqssNjbGIe9keNi/o28pRX7l6Zn wXJyxGSQTL2JF0HkU4hLbLgcTNQqIgrSnovcj0lViYillCQyTWGKpy51WB2Zaxm5uD6W uCfAJFIhV3IodpadGHadz8YL7scQll28pQU3ClADBQo1ro19cN42BzZFs9jB+vU1xdvb EV0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Ud59IYB2qfke9bviJXRaMauft6flh3KICl+04Mhz8ZA=; fh=566jFUvBbjM4l+whXX0cRnQnCnX4UNlFJ7ywcDPJHnk=; b=lzo4wNxV0Wcn0C9AHVxRGrM1GTXQrA4koia7snPNuUsWwBYEIhLkAY+SbbLWkN12cv Zwo66aksT8jwJCeZP7bqoSRdGX7IDRtFCZvGAQ4jVraQ+UHyKM4unVXGqT7aF8z14sCh 3ek9ciCA9gn/xEr774KY7DZ+jObikfyI8OucgAC8PP/nZBjoffRIsq8Dds7Ued6QWKJ0 +MFt3ntJzNYWcMDFKiWJpnRZeAR1jGepEvMQmwQYLINSL+2FOf2yTUWb63m/RGCfvF7a fFjQdKzd59AJxJY3USE/3HRuGO3SOqj3kkphrdd2/EMC/RfxwUcTPaSOg7HT2fOcpUZN GcvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cxcwwC32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id w19-20020a056a0014d300b006910e8e46e0si5028325pfu.371.2023.10.18.12.20.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 12:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cxcwwC32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4CB898221114; Wed, 18 Oct 2023 12:20:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231419AbjJRTUJ (ORCPT + 99 others); Wed, 18 Oct 2023 15:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230421AbjJRTUH (ORCPT ); Wed, 18 Oct 2023 15:20:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84722114; Wed, 18 Oct 2023 12:20:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7300BC433C7; Wed, 18 Oct 2023 19:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697656805; bh=mLpZTsjbH1oZAruNAaAWMqbAcvfjHo5jimN4dXHpcuI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cxcwwC32kJeRoubZdXCD5Ox6CFDVGJA7FazswfHZuXDlGIUoOcMcRIqhzLZSvWW8T NXXAiOYikRlG1wSe+B/6iZnMuoRYhvC7ZOkMlHWnR6kh33bc1/Vu4tzdgN50mHAhlI sXB/JnSxvCRyTtDAHYxALUAT0Ig/iOyop6+DIQiPASrNRIFqeqCpcyH6ELOgZgp7i8 zjjJPTFtYBXYa4iYHhY/eF5ruZukvVOHt/SsAdSBAuvD2pnjIbLq9CdN9uSSz2TB3X TM8s5IC/grZKTjXs3/5Ok5dHZIhpxRZ21vJIqiIvqempIQO3DyncGdldGFdL1AOApY PpwHM6LaCb+bA== Date: Wed, 18 Oct 2023 20:20:24 +0100 From: Jonathan Cameron To: Andreas Klinger Cc: Lars-Peter Clausen , Angel Iglesias , Andy Shevchenko , Linus Walleij , Sergei Korolev , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: bmp280: fix eoc interrupt usage Message-ID: <20231018202024.36aabbc1@jic23-huawei> In-Reply-To: <20231018152816.56589-1-ak@it-klinger.de> References: <20231018152816.56589-1-ak@it-klinger.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 12:20:20 -0700 (PDT) On Wed, 18 Oct 2023 17:28:16 +0200 Andreas Klinger wrote: > Only the bmp085 can have an End-Of-Conversion (EOC) interrupt. But the > bmp085 and bmp180 share the same chip id. Therefore it's necessary to > distinguish the case in which the interrupt is set. > > Fix the if statement so that only when the interrupt is set and the chip > id is recognized the interrupt is requested. > > This bug exists since the support of EOC interrupt was introduced. > Fixes: aae953949651 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt") > > Also add a link to bmp085 datasheet for reference. > Fixes tag is part of the tags block so needs to be down here. > Suggested-by: Sergei Korolev > Signed-off-by: Andreas Klinger However, it's also already fixed upstream I think. That's not filtered back around to my togreg branch though as that has an outstanding pull request. Jonathan > --- > drivers/iio/pressure/bmp280-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c > index 6089f3f9d8f4..9b7beeb1c088 100644 > --- a/drivers/iio/pressure/bmp280-core.c > +++ b/drivers/iio/pressure/bmp280-core.c > @@ -9,6 +9,7 @@ > * Driver for Bosch Sensortec BMP180 and BMP280 digital pressure sensor. > * > * Datasheet: > + * https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf > * https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf > * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf > * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf > @@ -2179,7 +2180,7 @@ int bmp280_common_probe(struct device *dev, > * however as it happens, the BMP085 shares the chip ID of BMP180 > * so we look for an IRQ if we have that. > */ > - if (irq > 0 || (chip_id == BMP180_CHIP_ID)) { > + if (irq > 0 && (chip_id == BMP180_CHIP_ID)) { > ret = bmp085_fetch_eoc_irq(dev, name, irq, data); > if (ret) > return ret;