* Re: [PATCH v8 14/17] iio: adc: ad4695: Add support for SPI offload
[not found] <20250207-dlech-mainline-spi-engine-offload-2-v8-14-e48a489be48c@baylibre.com>
@ 2025-02-09 0:14 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-09 0:14 UTC (permalink / raw)
To: David Lechner; +Cc: llvm, oe-kbuild-all
Hi David,
kernel test robot noticed the following build errors:
[auto build test ERROR on 884697cc74d9fea0a8628c2794d0b80065ac95d1]
url: https://github.com/intel-lab-lkp/linux/commits/David-Lechner/spi-add-basic-support-for-SPI-offloading/20250208-041627
base: 884697cc74d9fea0a8628c2794d0b80065ac95d1
patch link: https://lore.kernel.org/r/20250207-dlech-mainline-spi-engine-offload-2-v8-14-e48a489be48c%40baylibre.com
patch subject: [PATCH v8 14/17] iio: adc: ad4695: Add support for SPI offload
config: hexagon-randconfig-001-20250209 (https://download.01.org/0day-ci/archive/20250209/202502090806.KxEvxCZC-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 6807164500e9920638e2ab0cdb4bf8321d24f8eb)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250209/202502090806.KxEvxCZC-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502090806.KxEvxCZC-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/iio/adc/ad4695.c:801:3: error: cannot jump from this goto statement to its label
801 | goto err_offload_trigger_disable;
| ^
drivers/iio/adc/ad4695.c:803:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
803 | guard(mutex)(&st->cnv_pwm_lock);
| ^
include/linux/cleanup.h:309:15: note: expanded from macro 'guard'
309 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
| ^
include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
84 | #define __PASTE(a,b) ___PASTE(a,b)
| ^
include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
83 | #define ___PASTE(a,b) a##b
| ^
<scratch space>:30:1: note: expanded from here
30 | __UNIQUE_ID_guard434
| ^
drivers/iio/adc/ad4695.c:797:3: error: cannot jump from this goto statement to its label
797 | goto err_disable_busy_output;
| ^
drivers/iio/adc/ad4695.c:803:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
803 | guard(mutex)(&st->cnv_pwm_lock);
| ^
include/linux/cleanup.h:309:15: note: expanded from macro 'guard'
309 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
| ^
include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
84 | #define __PASTE(a,b) ___PASTE(a,b)
| ^
include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
83 | #define ___PASTE(a,b) a##b
| ^
<scratch space>:30:1: note: expanded from here
30 | __UNIQUE_ID_guard434
| ^
drivers/iio/adc/ad4695.c:792:3: error: cannot jump from this goto statement to its label
792 | goto err_unoptimize_message;
| ^
drivers/iio/adc/ad4695.c:803:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
803 | guard(mutex)(&st->cnv_pwm_lock);
| ^
include/linux/cleanup.h:309:15: note: expanded from macro 'guard'
309 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
| ^
include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
84 | #define __PASTE(a,b) ___PASTE(a,b)
| ^
include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
83 | #define ___PASTE(a,b) a##b
| ^
<scratch space>:30:1: note: expanded from here
30 | __UNIQUE_ID_guard434
| ^
3 errors generated.
vim +801 drivers/iio/adc/ad4695.c
723
724 static int ad4695_offload_buffer_postenable(struct iio_dev *indio_dev)
725 {
726 struct ad4695_state *st = iio_priv(indio_dev);
727 struct spi_offload_trigger_config config = {
728 .type = SPI_OFFLOAD_TRIGGER_DATA_READY,
729 };
730 struct spi_transfer *xfer = &st->buf_read_xfer[0];
731 struct pwm_state state;
732 u8 temp_chan_bit = st->chip_info->num_voltage_inputs;
733 u8 num_slots = 0;
734 u8 temp_en = 0;
735 unsigned int bit;
736 int ret;
737
738 iio_for_each_active_channel(indio_dev, bit) {
739 if (bit == temp_chan_bit) {
740 temp_en = 1;
741 continue;
742 }
743
744 ret = regmap_write(st->regmap, AD4695_REG_AS_SLOT(num_slots),
745 FIELD_PREP(AD4695_REG_AS_SLOT_INX, bit));
746 if (ret)
747 return ret;
748
749 num_slots++;
750 }
751
752 /*
753 * For non-offload, we could discard data to work around this
754 * restriction, but with offload, that is not possible.
755 */
756 if (num_slots < 2) {
757 dev_err(&st->spi->dev,
758 "At least two voltage channels must be enabled.\n");
759 return -EINVAL;
760 }
761
762 ret = regmap_update_bits(st->regmap, AD4695_REG_TEMP_CTRL,
763 AD4695_REG_TEMP_CTRL_TEMP_EN,
764 FIELD_PREP(AD4695_REG_TEMP_CTRL_TEMP_EN,
765 temp_en));
766 if (ret)
767 return ret;
768
769 /* Each BUSY event means just one sample for one channel is ready. */
770 memset(xfer, 0, sizeof(*xfer));
771 xfer->offload_flags = SPI_OFFLOAD_XFER_RX_STREAM;
772 /* Using 19 bits per word to allow for possible oversampling */
773 xfer->bits_per_word = 19;
774 xfer->len = 4;
775
776 spi_message_init_with_transfers(&st->buf_read_msg, xfer, 1);
777 st->buf_read_msg.offload = st->offload;
778
779 ret = spi_optimize_message(st->spi, &st->buf_read_msg);
780 if (ret)
781 return ret;
782
783 /*
784 * NB: technically, this is part the SPI offload trigger enable, but it
785 * doesn't work to call it from the offload trigger enable callback
786 * because it requires accessing the SPI bus. Calling it from the
787 * trigger enable callback could cause a deadlock.
788 */
789 ret = regmap_set_bits(st->regmap, AD4695_REG_GP_MODE,
790 AD4695_REG_GP_MODE_BUSY_GP_EN);
791 if (ret)
792 goto err_unoptimize_message;
793
794 ret = spi_offload_trigger_enable(st->offload, st->offload_trigger,
795 &config);
796 if (ret)
797 goto err_disable_busy_output;
798
799 ret = ad4695_enter_advanced_sequencer_mode(st, num_slots);
800 if (ret)
> 801 goto err_offload_trigger_disable;
802
803 guard(mutex)(&st->cnv_pwm_lock);
804 pwm_get_state(st->cnv_pwm, &state);
805 /*
806 * PWM subsystem generally rounds down, so requesting 2x minimum high
807 * time ensures that we meet the minimum high time in any case.
808 */
809 state.duty_cycle = AD4695_T_CNVH_NS * 2;
810 ret = pwm_apply_might_sleep(st->cnv_pwm, &state);
811 if (ret)
812 goto err_offload_exit_conversion_mode;
813
814 return 0;
815
816 err_offload_exit_conversion_mode:
817 /*
818 * We have to unwind in a different order to avoid triggering offload.
819 * ad4695_exit_conversion_mode() triggers a conversion, so it has to be
820 * done after spi_offload_trigger_disable().
821 */
822 spi_offload_trigger_disable(st->offload, st->offload_trigger);
823 ad4695_exit_conversion_mode(st);
824 goto err_disable_busy_output;
825
826 err_offload_trigger_disable:
827 spi_offload_trigger_disable(st->offload, st->offload_trigger);
828
829 err_disable_busy_output:
830 regmap_clear_bits(st->regmap, AD4695_REG_GP_MODE,
831 AD4695_REG_GP_MODE_BUSY_GP_EN);
832
833 err_unoptimize_message:
834 spi_unoptimize_message(&st->buf_read_msg);
835
836 return ret;
837 }
838
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-09 0:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250207-dlech-mainline-spi-engine-offload-2-v8-14-e48a489be48c@baylibre.com>
2025-02-09 0:14 ` [PATCH v8 14/17] iio: adc: ad4695: Add support for SPI offload kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox