Message ID | 20230404011455.339454-1-bmasney@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2696890vqo; Mon, 3 Apr 2023 18:23:46 -0700 (PDT) X-Google-Smtp-Source: AKy350ayyLZ+t5+ed/07dKgKeQaEsOyworjzbdtxYt4MqSjNpP4EggIQOWMmZ9yJ18rr2jErjYGa X-Received: by 2002:a17:906:1448:b0:929:7d80:3a37 with SMTP id q8-20020a170906144800b009297d803a37mr516783ejc.37.1680571425936; Mon, 03 Apr 2023 18:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680571425; cv=none; d=google.com; s=arc-20160816; b=Nr9G9Ns/cLzEykt4uEWApIEOxWQj25AXk/+//mFP6ncbCNVOZbYa9b4nlb4vxBJpGJ lL2BvpQootIoJJCoab39sKodqsG3uolvMr0u7MbpkxqeAFy9ltM/LmbWfoFepIdqjcqY YEWHr0drFeIqNBTfLLDAiAkdCepk4ky3dUSeXT2t5HO9/yBr1vlmb12ltU6BsMrcba2u M7F9ojKSrMaC6S/ZJE2fZZImynrSdhLBUfwvwVS5f4UuqtZo01ci0h5+M77HCy0qW4WT 50vwdM30o6EKFY+S5HyAjf5A5LDl9s7AkeQjw+FdKGCkSrS2akDVzyvIEXMbLjrinKit JzJA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=TSYL1BZlYm691L/hIPylGQ0hs5V7ipUIWqwof30ZZdE=; b=e15oIKghd67tM0vWrYuYoFi8+XBFdpdavOPrhsYv93QJYtSo+YnnKyrdy7zgGrBXEG IEnagBnh1XagSobCmznKzQddoYZTJsGPNorPZdAb2M45SDpfhB3KdFfrpG7p9StMLlm/ BcIKPtiSPKgOgDSSc1AuVoOqNKkYGgB5sM6008VMvX/owebBE932xwQWLedwo+c9Az5L s2MnL8xumL2zHekKkH7mxItPc9tvJKN9zhvNl9/2OkAUz0+A9r4vQaUgCdRbHtBD5Pma ZwBYWfKgTuEkpW7EXjbuyWyWcSCfgAXSB3fc8jN9b3V9C74ds9r5otH752MP1Lq78bpF 8+KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Slp+Zmmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a170906840300b00936255a28b0si1020800ejx.865.2023.04.03.18.23.22; Mon, 03 Apr 2023 18:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Slp+Zmmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbjDDBPy (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 3 Apr 2023 21:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjDDBPw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 21:15:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C72B2101 for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 18:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680570905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSYL1BZlYm691L/hIPylGQ0hs5V7ipUIWqwof30ZZdE=; b=Slp+ZmmxIEDJw0dr0arbVUIE1OnkMz8AO1nnPczt90VgwHCDQVHIeLgT9VaQ+yyt3QDpq4 i/ehpGXPL1Gi9SMPt3fkWPaMwpA1hHKKxhhWtXH58EX5YfT59+gfZreqDzAsgIz640V1XE MRT4l5TWfCzGKrZjnTFePI5eVWRFPdc= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-o9oh0XNzNPOGHEQiieFzng-1; Mon, 03 Apr 2023 21:15:04 -0400 X-MC-Unique: o9oh0XNzNPOGHEQiieFzng-1 Received: by mail-qv1-f71.google.com with SMTP id a10-20020a0ccdca000000b005d70160fbb0so13878725qvn.21 for <linux-kernel@vger.kernel.org>; Mon, 03 Apr 2023 18:15:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680570903; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TSYL1BZlYm691L/hIPylGQ0hs5V7ipUIWqwof30ZZdE=; b=fMDpgB1aFU7VLvAWwBUT8ulLeUfmsYfNwVRfLdD8X8e+iKNP4fsRmo6tCVenHfqhUW QpC3YcF/qumZ5Avv+n0Z5fVRz0UY6XIDnuRVw+sZI9YHh23fx3lvwqlf2NUeoSIbC1Sc m8K9qzvedN2ZClOaRe7d1bxY1+vusc/R9IgmN0UGINcp5ITtzySSVwhU1iinXfr9QH2X zzTd7cMjtLS/R6gKgur8E8Yb0wKIQwvnlzZMMUcvfFDWCKqNe0Bj1CrlsHsEI9RYyTwT gPNu8iZFdCZwjTbNo2Epdi07zZ3c12m+7TmmhKKQwuyqmfrPa2cdyivTxcmPAFYIwSvI 7hjg== X-Gm-Message-State: AAQBX9fY44pRWqLLktFN6IUWQiNre4+MqaNNS2QFOIgdlWccB6BCvaJD YtiEi9ilcYLVi9R63mc2sRo8udEhpld35aDNrf0CLsDjHEnclwEGuri2freKqzVALc5dFNvODml s1n/rMwJ1rPmm9lA3Mho1Ery9 X-Received: by 2002:a05:622a:38a:b0:3e4:ee22:a50e with SMTP id j10-20020a05622a038a00b003e4ee22a50emr964225qtx.7.1680570903644; Mon, 03 Apr 2023 18:15:03 -0700 (PDT) X-Received: by 2002:a05:622a:38a:b0:3e4:ee22:a50e with SMTP id j10-20020a05622a038a00b003e4ee22a50emr964205qtx.7.1680570903369; Mon, 03 Apr 2023 18:15:03 -0700 (PDT) Received: from x1.. (c-73-214-169-22.hsd1.pa.comcast.net. [73.214.169.22]) by smtp.gmail.com with ESMTPSA id o26-20020ac841da000000b003de4e646d63sm2919574qtm.32.2023.04.03.18.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 18:15:02 -0700 (PDT) From: Brian Masney <bmasney@redhat.com> To: jic23@kernel.org Cc: andriy.shevchenko@linux.intel.com, trix@redhat.com, lars@metafoo.de, nathan@kernel.org, ndesaulniers@google.com, u.kleine-koenig@pengutronix.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, hslester96@gmail.com Subject: [PATCH] iio: light: tsl2772: fix reading proximity-diodes from device tree Date: Mon, 3 Apr 2023 21:14:55 -0400 Message-Id: <20230404011455.339454-1-bmasney@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762206863484286669?= X-GMAIL-MSGID: =?utf-8?q?1762206863484286669?= |
Series |
iio: light: tsl2772: fix reading proximity-diodes from device tree
|
|
Commit Message
Brian Masney
April 4, 2023, 1:14 a.m. UTC
tsl2772_read_prox_diodes() will correctly parse the properties from
device tree to determine which proximity diode(s) to read from, however
it didn't actually set this value on the struct tsl2772_settings. Let's
go ahead and fix that.
Reported-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/lkml/20230327120823.1369700-1-trix@redhat.com/
Fixes: 94cd1113aaa0 ("iio: tsl2772: add support for reading proximity led settings from device tree")
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/iio/light/tsl2772.c | 1 +
1 file changed, 1 insertion(+)
Comments
Hi Brian, kernel test robot noticed the following build errors: [auto build test ERROR on jic23-iio/togreg] [also build test ERROR on linus/master v6.3-rc5 next-20230403] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Brian-Masney/iio-light-tsl2772-fix-reading-proximity-diodes-from-device-tree/20230404-091630 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg patch link: https://lore.kernel.org/r/20230404011455.339454-1-bmasney%40redhat.com patch subject: [PATCH] iio: light: tsl2772: fix reading proximity-diodes from device tree config: x86_64-randconfig-a001-20230403 (https://download.01.org/0day-ci/archive/20230404/202304041451.gj8oasQp-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/9701bd10d6409568197894b603f8a1e23280e82b git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Brian-Masney/iio-light-tsl2772-fix-reading-proximity-diodes-from-device-tree/20230404-091630 git checkout 9701bd10d6409568197894b603f8a1e23280e82b # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iio/light/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304041451.gj8oasQp-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/iio/light/tsl2772.c:599:30: error: use of undeclared identifier 'prox_diode_mask'; did you mean 'protnone_mask'? chip->settings.prox_diode = prox_diode_mask; ^~~~~~~~~~~~~~~ protnone_mask arch/x86/include/asm/pgtable-invert.h:22:19: note: 'protnone_mask' declared here static inline u64 protnone_mask(u64 val) ^ 1 error generated. vim +599 drivers/iio/light/tsl2772.c 572 573 static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip) 574 { 575 struct device *dev = &chip->client->dev; 576 int i, ret, num_leds; 577 u32 leds[TSL2772_MAX_PROX_LEDS]; 578 579 ret = device_property_count_u32(dev, "amstaos,proximity-diodes"); 580 if (ret < 0) 581 return ret; 582 583 num_leds = ret; 584 if (num_leds > TSL2772_MAX_PROX_LEDS) 585 num_leds = TSL2772_MAX_PROX_LEDS; 586 587 ret = device_property_read_u32_array(dev, "amstaos,proximity-diodes", leds, num_leds); 588 if (ret < 0) { 589 dev_err(dev, "Invalid value for amstaos,proximity-diodes: %d.\n", ret); 590 return ret; 591 } 592 593 for (i = 0; i < num_leds; i++) { 594 if (leds[i] > 1) { 595 dev_err(dev, "Invalid value %d in amstaos,proximity-diodes.\n", leds[i]); 596 return -EINVAL; 597 } 598 } > 599 chip->settings.prox_diode = prox_diode_mask; 600 601 return 0; 602 } 603
Hi kernel test robot maintainers, On Tue, Apr 04, 2023 at 03:13:24PM +0800, kernel test robot wrote: > Hi Brian, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on jic23-iio/togreg] > [also build test ERROR on linus/master v6.3-rc5 next-20230403] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Brian-Masney/iio-light-tsl2772-fix-reading-proximity-diodes-from-device-tree/20230404-091630 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg > patch link: https://lore.kernel.org/r/20230404011455.339454-1-bmasney%40redhat.com > patch subject: [PATCH] iio: light: tsl2772: fix reading proximity-diodes from device tree > config: x86_64-randconfig-a001-20230403 (https://download.01.org/0day-ci/archive/20230404/202304041451.gj8oasQp-lkp@intel.com/config) > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/9701bd10d6409568197894b603f8a1e23280e82b > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Brian-Masney/iio-light-tsl2772-fix-reading-proximity-diodes-from-device-tree/20230404-091630 > git checkout 9701bd10d6409568197894b603f8a1e23280e82b > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iio/light/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > | Link: https://lore.kernel.org/oe-kbuild-all/202304041451.gj8oasQp-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > >> drivers/iio/light/tsl2772.c:599:30: error: use of undeclared identifier 'prox_diode_mask'; did you mean 'protnone_mask'? > chip->settings.prox_diode = prox_diode_mask; > ^~~~~~~~~~~~~~~ > protnone_mask > arch/x86/include/asm/pgtable-invert.h:22:19: note: 'protnone_mask' declared here > static inline u64 protnone_mask(u64 val) > ^ > 1 error generated. > > > vim +599 drivers/iio/light/tsl2772.c > > 572 > 573 static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip) > 574 { > 575 struct device *dev = &chip->client->dev; > 576 int i, ret, num_leds; > 577 u32 leds[TSL2772_MAX_PROX_LEDS]; > 578 > 579 ret = device_property_count_u32(dev, "amstaos,proximity-diodes"); > 580 if (ret < 0) > 581 return ret; > 582 > 583 num_leds = ret; > 584 if (num_leds > TSL2772_MAX_PROX_LEDS) > 585 num_leds = TSL2772_MAX_PROX_LEDS; > 586 > 587 ret = device_property_read_u32_array(dev, "amstaos,proximity-diodes", leds, num_leds); > 588 if (ret < 0) { > 589 dev_err(dev, "Invalid value for amstaos,proximity-diodes: %d.\n", ret); > 590 return ret; > 591 } > 592 > 593 for (i = 0; i < num_leds; i++) { > 594 if (leds[i] > 1) { > 595 dev_err(dev, "Invalid value %d in amstaos,proximity-diodes.\n", leds[i]); > 596 return -EINVAL; > 597 } > 598 } > > 599 chip->settings.prox_diode = prox_diode_mask; > 600 > 601 return 0; > 602 } > 603 This doesn't contain the code that's in iio/togreg [1], and that's why the build failed. I originally developed / built this against next-20230330. I just checked linus/master, next-20230404, iio/testing, and all have the expected code that defines prox_diode_mask. [1] https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/drivers/iio/light/tsl2772.c?h=togreg#n593 Brian
Hello Brian, On Tue, Apr 04, 2023 at 07:13:03AM -0400, Brian Masney wrote: > This doesn't contain the code that's in iio/togreg [1], and that's why > the build failed. I originally developed / built this against > next-20230330. I just checked linus/master, next-20230404, iio/testing, > and all have the expected code that defines prox_diode_mask. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/drivers/iio/light/tsl2772.c?h=togreg#n593 You might want to make use of the --base parameter to git format-patch for you next submission. With that the auto builders have a chance to test on the right tree. Best regards Uwe
On Tue, Apr 04, 2023 at 02:35:44PM +0200, Uwe Kleine-König wrote: > Hello Brian, > > On Tue, Apr 04, 2023 at 07:13:03AM -0400, Brian Masney wrote: > > This doesn't contain the code that's in iio/togreg [1], and that's why > > the build failed. I originally developed / built this against > > next-20230330. I just checked linus/master, next-20230404, iio/testing, > > and all have the expected code that defines prox_diode_mask. > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/drivers/iio/light/tsl2772.c?h=togreg#n593 > > You might want to make use of the --base parameter to git format-patch > for you next submission. With that the auto builders have a chance to > test on the right tree. I'll add the --base parameter next time. However, I think the issue is that this compiler error is triggered by this patch [1] that's not in any maintainer trees. I suspect the kernel test robot still has that in it's local tree from a previous round of testing against this driver. [1] https://lore.kernel.org/lkml/20230327120823.1369700-1-trix@redhat.com/ Brian
On Mon, 3 Apr 2023 21:14:55 -0400 Brian Masney <bmasney@redhat.com> wrote: > tsl2772_read_prox_diodes() will correctly parse the properties from > device tree to determine which proximity diode(s) to read from, however > it didn't actually set this value on the struct tsl2772_settings. Let's > go ahead and fix that. > > Reported-by: Tom Rix <trix@redhat.com> > Link: https://lore.kernel.org/lkml/20230327120823.1369700-1-trix@redhat.com/ > Fixes: 94cd1113aaa0 ("iio: tsl2772: add support for reading proximity led settings from device tree") > Signed-off-by: Brian Masney <bmasney@redhat.com> Applied to the fixes-togreg branch of iio.git and marked for stable. thanks, Jonathan > --- > drivers/iio/light/tsl2772.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c > index ad50baa0202c..e823c145f679 100644 > --- a/drivers/iio/light/tsl2772.c > +++ b/drivers/iio/light/tsl2772.c > @@ -601,6 +601,7 @@ static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip) > return -EINVAL; > } > } > + chip->settings.prox_diode = prox_diode_mask; > > return 0; > }
diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c index ad50baa0202c..e823c145f679 100644 --- a/drivers/iio/light/tsl2772.c +++ b/drivers/iio/light/tsl2772.c @@ -601,6 +601,7 @@ static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip) return -EINVAL; } } + chip->settings.prox_diode = prox_diode_mask; return 0; }