[pm:bleeding-edge 59/60] drivers/power/avs/qcom-cpr.c:838:15: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'ssize_t {aka int}'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head: 89eba9e38dc4ed4576eaf7711c60403568663291
commit: bf6910abf54871b0e976e52f56fb3b3dd1b90e48 [59/60] power: avs: Add support for CPR (Core Power Reduction)
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout bf6910abf54871b0e976e52f56fb3b3dd1b90e48
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/printk.h:331:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/power/avs/qcom-cpr.c:7:
drivers/power/avs/qcom-cpr.c: In function 'cpr_read_efuse':
>> drivers/power/avs/qcom-cpr.c:838:15: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'ssize_t {aka int}' [-Wformat=]
dev_dbg(dev, "efuse read(%s) = %x, bytes %ld\n", cname, *data, len);
^
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~
include/linux/device.h:1784:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~
include/linux/device.h:1784:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/power/avs/qcom-cpr.c:838:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dev, "efuse read(%s) = %x, bytes %ld\n", cname, *data, len);
^~~~~~~
vim +838 drivers/power/avs/qcom-cpr.c
810
811 static int cpr_read_efuse(struct device *dev, const char *cname, u32 *data)
812 {
813 struct nvmem_cell *cell;
814 ssize_t len;
815 char *ret;
816 int i;
817
818 *data = 0;
819
820 cell = nvmem_cell_get(dev, cname);
821 if (IS_ERR(cell)) {
822 if (PTR_ERR(cell) != -EPROBE_DEFER)
823 dev_err(dev, "undefined cell %s\n", cname);
824 return PTR_ERR(cell);
825 }
826
827 ret = nvmem_cell_read(cell, &len);
828 nvmem_cell_put(cell);
829 if (IS_ERR(ret)) {
830 dev_err(dev, "can't read cell %s\n", cname);
831 return PTR_ERR(ret);
832 }
833
834 for (i = 0; i < len; i++)
835 *data |= ret[i] << (8 * i);
836
837 kfree(ret);
> 838 dev_dbg(dev, "efuse read(%s) = %x, bytes %ld\n", cname, *data, len);
839
840 return 0;
841 }
842
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
2 years, 5 months
Re: [Devel] [PATCH] ACPICA: Fix compilation with bare-metal toolchian
by Rafael J. Wysocki
On Saturday, June 22, 2019 11:03:54 PM CEST Laster K. wrote:
> An ifdef expects to be compiled with full-fledged Linux toolchain,
> but it's common to compile kernel with just bare-metal toolchain
> which doesn't define __linux__. So, also add __KERNEL__ check.
>
> Signed-off-by: Laster K. (lazerl0rd) <officiallazerl0rd(a)gmail.com>
> ---
> Apologies for the multiple/spammed e-mails, I was having mail client issues.
>
> include/acpi/platform/acenv.h | 2 +-
> include/acpi/platform/acenvex.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
> index 35ab3f87cc29..b69319198cb8 100644
> --- a/include/acpi/platform/acenv.h
> +++ b/include/acpi/platform/acenv.h
> @@ -148,7 +148,7 @@
>
> #endif
>
> -#if defined(_LINUX) || defined(__linux__)
> +#if defined(_LINUX) || defined(__KERNEL__) || defined(__linux__)
> #include <acpi/platform/aclinux.h>
>
> #elif defined(_APPLE) || defined(__APPLE__)
> diff --git a/include/acpi/platform/acenvex.h b/include/acpi/platform/acenvex.h
> index 2e36c8344897..c7697a47e33f 100644
> --- a/include/acpi/platform/acenvex.h
> +++ b/include/acpi/platform/acenvex.h
> @@ -19,7 +19,7 @@
> *
> *****************************************************************************/
>
> -#if defined(_LINUX) || defined(__linux__)
> +#if defined(_LINUX) || defined(__KERNEL__) || defined(__linux__)
> #include <acpi/platform/aclinuxex.h>
>
> #elif defined(__DragonFly__)
>
Erik, Bob, any input here?
2 years, 5 months
Re: [kbuild-all] Re: [pm:intel_idle+acpi 4/10] acpi_processor.c:undefined reference to `acpi_processor_ffh_cstate_probe'
by Rafael J. Wysocki
On Tue, Dec 17, 2019 at 1:31 AM Li, Philip <philip.li(a)intel.com> wrote:
>
> > Subject: [kbuild-all] Re: [pm:intel_idle+acpi 4/10] acpi_processor.c:undefined
> > reference to `acpi_processor_ffh_cstate_probe'
> >
> > On Mon, Dec 16, 2019 at 2:26 PM kbuild test robot <lkp(a)intel.com> wrote:
> > >
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
> > intel_idle+acpi
> > > head: dcedc03145600b929a32acb85b212131b079bc46
> > > commit: 0300cf31f061e6287810c894337f29df2e200e2d [4/10] ACPI: processor:
> > Export acpi_processor_evaluate_cst()
> >
> > Outdated. Please stop sending these.
> thanks for the input Rafael, we will ignore the following tests on it.
Well, the branch has been rebased since then and effectively it is a new one.
My point is that if something like that happens, the script should
discard the old branch and pull the new one from scratch.
2 years, 5 months
[pm:intel_idle+acpi 4/10] drivers/acpi/acpi_processor.c:831: undefined reference to `acpi_processor_ffh_cstate_probe'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git intel_idle+acpi
head: dcedc03145600b929a32acb85b212131b079bc46
commit: 0300cf31f061e6287810c894337f29df2e200e2d [4/10] ACPI: processor: Export acpi_processor_evaluate_cst()
config: x86_64-randconfig-s0-20191216 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
git checkout 0300cf31f061e6287810c894337f29df2e200e2d
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ld: drivers/acpi/acpi_processor.o: in function `acpi_processor_evaluate_cst':
>> drivers/acpi/acpi_processor.c:831: undefined reference to `acpi_processor_ffh_cstate_probe'
vim +831 drivers/acpi/acpi_processor.c
732
733 /**
734 * acpi_processor_evaluate_cst - Evaluate the processor _CST control method.
735 * @handle: ACPI handle of the processor object containing the _CST.
736 * @cpu: The numeric ID of the target CPU.
737 * @info: Object write the C-states information into.
738 *
739 * Extract the C-state information for the given CPU from the output of the _CST
740 * control method under the corresponding ACPI processor object (or processor
741 * device object) and populate @info with it.
742 *
743 * If any ACPI_ADR_SPACE_FIXED_HARDWARE C-states are found, invoke
744 * acpi_processor_ffh_cstate_probe() to verify them and update the
745 * cpu_cstate_entry data for @cpu.
746 */
747 int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu,
748 struct acpi_processor_power *info)
749 {
750 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
751 union acpi_object *cst;
752 acpi_status status;
753 u64 count;
754 int last_index = 0;
755 int i, ret = 0;
756
757 status = acpi_evaluate_object(handle, "_CST", NULL, &buffer);
758 if (ACPI_FAILURE(status)) {
759 acpi_handle_debug(handle, "No _CST\n");
760 return -ENODEV;
761 }
762
763 cst = buffer.pointer;
764
765 /* There must be at least 2 elements. */
766 if (!cst || cst->type != ACPI_TYPE_PACKAGE || cst->package.count < 2) {
767 acpi_handle_warn(handle, "Invalid _CST output\n");
768 ret = -EFAULT;
769 goto end;
770 }
771
772 count = cst->package.elements[0].integer.value;
773
774 /* Validate the number of C-states. */
775 if (count < 1 || count != cst->package.count - 1) {
776 acpi_handle_warn(handle, "Inconsistent _CST data\n");
777 ret = -EFAULT;
778 goto end;
779 }
780
781 for (i = 1; i <= count; i++) {
782 union acpi_object *element;
783 union acpi_object *obj;
784 struct acpi_power_register *reg;
785 struct acpi_processor_cx cx;
786
787 /*
788 * If there is not enough space for all C-states, skip the
789 * excess ones and log a warning.
790 */
791 if (last_index >= ACPI_PROCESSOR_MAX_POWER - 1) {
792 acpi_handle_warn(handle,
793 "No room for more idle states (limit: %d)\n",
794 ACPI_PROCESSOR_MAX_POWER - 1);
795 break;
796 }
797
798 memset(&cx, 0, sizeof(cx));
799
800 element = &cst->package.elements[i];
801 if (element->type != ACPI_TYPE_PACKAGE)
802 continue;
803
804 if (element->package.count != 4)
805 continue;
806
807 obj = &element->package.elements[0];
808
809 if (obj->type != ACPI_TYPE_BUFFER)
810 continue;
811
812 reg = (struct acpi_power_register *)obj->buffer.pointer;
813
814 obj = &element->package.elements[1];
815 if (obj->type != ACPI_TYPE_INTEGER)
816 continue;
817
818 cx.type = obj->integer.value;
819 /*
820 * There are known cases in which the _CST output does not
821 * contain C1, so if the type of the first state found is not
822 * C1, leave an empty slot for C1 to be filled in later.
823 */
824 if (i == 1 && cx.type != ACPI_STATE_C1)
825 last_index = 1;
826
827 cx.address = reg->address;
828 cx.index = last_index + 1;
829
830 if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
> 831 if (!acpi_processor_ffh_cstate_probe(cpu, &cx, reg)) {
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
2 years, 5 months
ACPICA version 20191213 released
by Moore, Robert
13 December 2019. Summary of changes for version 20191213:
This release is available at https://acpica.org/downloads
1) ACPICA kernel-resident subsystem:
Return a Buffer object for all fields created via the CreateField operator. Previously, an Integer would be returned if the size of the field was less than or equal to the current size of an Integer. Although this goes against the ACPI specification, it provides compatibility with other ACPI implementations. Also updated the ASLTS test suite to reflect this new behavior.
2) iASL Compiler/Disassembler and ACPICA tools:
iASL: Implemented detection of (and throw an error for) duplicate values for Case statements within a single Switch statement. Duplicate Integers, Strings, and Buffers are supported.
iASL: Fix error logging issue during multiple file compilation -- Switch to the correct input file during error node creation.
iASL: For duplicate named object creation, now emit an error instead of a warning - since this will cause a runtime error.
AcpiSrc: Add unix line-ending support for non-Windows builds.
iASL: Add an error condition for an attempt to create a NameString with > 255 NameSegs (the max allowable via the AML definition).
2 years, 5 months
[pm:bleeding-edge 6/7] drivers/base/test/property-entry-test.c:454:1: warning: the frame size of 2960 bytes is larger than 2048 bytes
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head: 88a29de6adffb9d4d1ac7f1b1d996c616ebda145
commit: 80e0582b1ab83ed08dedaad5a0cdb28457ccba4f [6/7] software node: add basic tests for property entries
config: arm64-randconfig-a001-20191203 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 80e0582b1ab83ed08dedaad5a0cdb28457ccba4f
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/base/test/property-entry-test.c: In function 'pe_test_reference':
>> drivers/base/test/property-entry-test.c:454:1: warning: the frame size of 2960 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
drivers/base/test/property-entry-test.c: In function 'pe_test_uint_arrays':
drivers/base/test/property-entry-test.c:214:1: warning: the frame size of 4288 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
drivers/base/test/property-entry-test.c: In function 'pe_test_uints':
drivers/base/test/property-entry-test.c:99:1: warning: the frame size of 2736 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
vim +454 drivers/base/test/property-entry-test.c
360
361 /* Handling of reference properties */
362 static void pe_test_reference(struct kunit *test)
363 {
364 const struct software_node nodes[] = {
365 { .name = "1", },
366 { .name = "2", },
367 };
368
369 const struct software_node_ref_args refs[] = {
370 {
371 .node = &nodes[0],
372 .nargs = 0,
373 },
374 {
375 .node = &nodes[1],
376 .nargs = 2,
377 .args = { 3, 4 },
378 },
379 };
380
381 const struct property_entry entries[] = {
382 PROPERTY_ENTRY_REF("ref-1", &nodes[0]),
383 PROPERTY_ENTRY_REF("ref-2", &nodes[1], 1, 2),
384 PROPERTY_ENTRY_REF_ARRAY("ref-3", refs),
385 { }
386 };
387
388 struct fwnode_handle *node;
389 struct fwnode_reference_args ref;
390 int error;
391
392 error = software_node_register_nodes(nodes);
393 KUNIT_ASSERT_EQ(test, error, 0);
394
395 node = fwnode_create_software_node(entries, NULL);
396 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node);
397
398 error = fwnode_property_get_reference_args(node, "ref-1", NULL,
399 0, 0, &ref);
400 KUNIT_ASSERT_EQ(test, error, 0);
401 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[0]);
402 KUNIT_EXPECT_EQ(test, ref.nargs, 0U);
403
404 /* wrong index */
405 error = fwnode_property_get_reference_args(node, "ref-1", NULL,
406 0, 1, &ref);
407 KUNIT_EXPECT_NE(test, error, 0);
408
409 error = fwnode_property_get_reference_args(node, "ref-2", NULL,
410 1, 0, &ref);
411 KUNIT_ASSERT_EQ(test, error, 0);
412 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[1]);
413 KUNIT_EXPECT_EQ(test, ref.nargs, 1U);
414 KUNIT_EXPECT_EQ(test, ref.args[0], 1LLU);
415
416 /* asking for more args, padded with zero data */
417 error = fwnode_property_get_reference_args(node, "ref-2", NULL,
418 3, 0, &ref);
419 KUNIT_ASSERT_EQ(test, error, 0);
420 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[1]);
421 KUNIT_EXPECT_EQ(test, ref.nargs, 3U);
422 KUNIT_EXPECT_EQ(test, ref.args[0], 1LLU);
423 KUNIT_EXPECT_EQ(test, ref.args[1], 2LLU);
424 KUNIT_EXPECT_EQ(test, ref.args[2], 0LLU);
425
426 /* wrong index */
427 error = fwnode_property_get_reference_args(node, "ref-2", NULL,
428 2, 1, &ref);
429 KUNIT_EXPECT_NE(test, error, 0);
430
431 /* array of references */
432 error = fwnode_property_get_reference_args(node, "ref-3", NULL,
433 0, 0, &ref);
434 KUNIT_ASSERT_EQ(test, error, 0);
435 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[0]);
436 KUNIT_EXPECT_EQ(test, ref.nargs, 0U);
437
438 /* second reference in the array */
439 error = fwnode_property_get_reference_args(node, "ref-3", NULL,
440 2, 1, &ref);
441 KUNIT_ASSERT_EQ(test, error, 0);
442 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[1]);
443 KUNIT_EXPECT_EQ(test, ref.nargs, 2U);
444 KUNIT_EXPECT_EQ(test, ref.args[0], 3LLU);
445 KUNIT_EXPECT_EQ(test, ref.args[1], 4LLU);
446
447 /* wrong index */
448 error = fwnode_property_get_reference_args(node, "ref-1", NULL,
449 0, 2, &ref);
450 KUNIT_EXPECT_NE(test, error, 0);
451
452 fwnode_remove_software_node(node);
453 software_node_unregister_nodes(nodes);
> 454 }
455
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
2 years, 5 months
Re: [PATCH] ACPICA: Use ARRAY_SIZE for 'fadt_info_table','fadt_pm_info_table'
by Moore, Robert
Where does "ARRAY_SIZE" come from? It's not a part of ACPICA.
Bob
-----Original Message-----
From: zhengbin <zhengbin13(a)huawei.com>
Sent: Friday, November 22, 2019 1:33 AM
To: Moore, Robert <robert.moore(a)intel.com>; Schmauss, Erik <erik.schmauss(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; lenb(a)kernel.org; linux-acpi(a)vger.kernel.org; devel(a)acpica.org
Cc: zhengbin13(a)huawei.com
Subject: [PATCH] ACPICA: Use ARRAY_SIZE for 'fadt_info_table','fadt_pm_info_table'
Fixes coccicheck warning:
drivers/acpi/acpica/tbfadt.c:107:27-28: WARNING: Use ARRAY_SIZE
drivers/acpi/acpica/tbfadt.c:137:30-31: WARNING: Use ARRAY_SIZE
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Signed-off-by: zhengbin <zhengbin13(a)huawei.com>
---
drivers/acpi/acpica/tbfadt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 0041bfb..324a804 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -103,8 +103,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER} };
-#define ACPI_FADT_INFO_ENTRIES \
- (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
+#define ACPI_FADT_INFO_ENTRIES (ARRAY_SIZE(fadt_info_table))
/* Table used to split Event Blocks into separate status/enable registers */
@@ -133,8 +132,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
1}
};
-#define ACPI_FADT_PM_INFO_ENTRIES \
- (sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info))
+#define ACPI_FADT_PM_INFO_ENTRIES (ARRAY_SIZE(fadt_pm_info_table))
/*******************************************************************************
*
--
2.7.4
2 years, 5 months