kernel/time/hrtimer.c:650:19: warning: unused function 'hrtimer_hres_active'
by kernel test robot
Hi Thomas,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 754e0b0e35608ed5206d6a67a791563c631cec07
commit: 9482fd71dbb8f0d1a61821a83e467dc0a9d7b429 hrtimer: Use raw_cpu_ptr() in clock_was_set()
date: 6 months ago
config: mips-randconfig-r033-20220213 (https://download.01.org/0day-ci/archive/20220214/202202142217.xTcn7mgj-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
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
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9482fd71dbb8f0d1a61821a83e467dc0a9d7b429
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash fs/ kernel/time/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/time/hrtimer.c:120:21: warning: initializer overrides prior initialization of this subobject
= HRTIMER_BASE_REALTIME,
^~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:118:27: note: previous initialization is here
[0 ... MAX_CLOCKS - 1] = HRTIMER_MAX_CLOCK_BASES,
^~~~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:121:22: warning: initializer overrides prior initialization of this subobject
= HRTIMER_BASE_MONOTONIC,
^~~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:118:27: note: previous initialization is here
[0 ... MAX_CLOCKS - 1] = HRTIMER_MAX_CLOCK_BASES,
^~~~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:122:21: warning: initializer overrides prior initialization of this subobject
= HRTIMER_BASE_BOOTTIME,
^~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:118:27: note: previous initialization is here
[0 ... MAX_CLOCKS - 1] = HRTIMER_MAX_CLOCK_BASES,
^~~~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:123:17: warning: initializer overrides prior initialization of this subobject
= HRTIMER_BASE_TAI,
^~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:118:27: note: previous initialization is here
[0 ... MAX_CLOCKS - 1] = HRTIMER_MAX_CLOCK_BASES,
^~~~~~~~~~~~~~~~~~~~~~~
kernel/time/hrtimer.c:1648:7: warning: variable 'expires_in_hardirq' set but not used
bool expires_in_hardirq;
^
kernel/time/hrtimer.c:276:20: warning: unused function 'is_migration_base'
static inline bool is_migration_base(struct hrtimer_clock_base
^
>> kernel/time/hrtimer.c:650:19: warning: unused function 'hrtimer_hres_active'
static inline int hrtimer_hres_active(void)
^
kernel/time/hrtimer.c:1887:20: warning: unused function '__hrtimer_peek_ahead_timers'
static inline void __hrtimer_peek_ahead_timers(void) { }
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set mips64r2
.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/bitops.h", .line = 105, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $0, $1
or $0, $2
sc $0, $1
beqz $0, 1b
.set pop
'
clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (git://gitmirror/llvm_project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
Target: mips-unknown-linux
Thread model: posix
InstalledDir: /opt/cross/clang-ea071884b0/bin
clang-15: note: diagnostic msg:
Makefile arch block certs crypto drivers fs include init ipc kernel lib mm scripts security sound source usr virt
vim +/hrtimer_hres_active +650 kernel/time/hrtimer.c
28bfd18bf3daa5 Anna-Maria Gleixner 2017-12-21 649
28bfd18bf3daa5 Anna-Maria Gleixner 2017-12-21 @650 static inline int hrtimer_hres_active(void)
28bfd18bf3daa5 Anna-Maria Gleixner 2017-12-21 651 {
28bfd18bf3daa5 Anna-Maria Gleixner 2017-12-21 652 return __hrtimer_hres_active(this_cpu_ptr(&hrtimer_bases));
28bfd18bf3daa5 Anna-Maria Gleixner 2017-12-21 653 }
28bfd18bf3daa5 Anna-Maria Gleixner 2017-12-21 654
:::::: The code at line 650 was first introduced by commit
:::::: 28bfd18bf3daa5db8bb3422ea7138c8b7d2444ac hrtimer: Make the hrtimer_cpu_base::hres_active field unconditional, to simplify the code
:::::: TO: Anna-Maria Gleixner <anna-maria(a)linutronix.de>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[jgunthorpe:iommufd 23/31] drivers/iommu/iommufd/io_pagetable.c:488:6: error: comparison of distinct pointer types ('typeof (iova) *' (aka 'unsigned long *') and 'typeof (length - 1) *' (aka 'unsigned int *'))
by kernel test robot
tree: https://github.com/jgunthorpe/linux iommufd
head: 6b5b3f20ed6b64824c2d447b4f4555fcb390bf3b
commit: 01c5309803286f2c29a6f40bca7f489fce968c42 [23/31] iommufd: Data structure to provide IOVA to PFN mapping
config: i386-randconfig-a004-20220214 (https://download.01.org/0day-ci/archive/20220214/202202142244.2jylcKcV-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
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/jgunthorpe/linux/commit/01c5309803286f2c29a6f40bca7f48...
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe iommufd
git checkout 01c5309803286f2c29a6f40bca7f489fce968c42
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/iommu/iommufd/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/iommu/iommufd/io_pagetable.c:488:6: error: comparison of distinct pointer types ('typeof (iova) *' (aka 'unsigned long *') and 'typeof (length - 1) *' (aka 'unsigned int *')) [-Werror,-Wcompare-distinct-pointer-types]
if (check_add_overflow(iova, length - 1, &last_iova))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/overflow.h:66:15: note: expanded from macro 'check_add_overflow'
(void) (&__a == &__b); \
~~~~ ^ ~~~~
drivers/iommu/iommufd/io_pagetable.c:548:14: error: comparison of distinct pointer types ('typeof (iova) *' (aka 'unsigned long *') and 'typeof (length - 1) *' (aka 'unsigned int *')) [-Werror,-Wcompare-distinct-pointer-types]
WARN_ON(check_add_overflow(iova, length - 1, &last_iova)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/overflow.h:66:15: note: expanded from macro 'check_add_overflow'
(void) (&__a == &__b); \
~~~~ ^ ~~~~
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
2 errors generated.
vim +488 drivers/iommu/iommufd/io_pagetable.c
462
463 /**
464 * iopt_access_pages - Return a list of pages under the iova
465 *
466 * Reads @npages starting at iova and returns the struct page * pointers. These
467 * can be kmap'd by the caller for CPU access.
468 *
469 * The caller must perform iopt_unaccess_pages() when done to balance this.
470 *
471 * iova can be unaligned from PAGE_SIZE. The first returned byte starts at
472 * page_to_phys(out_pages[0]) + (iova % PAGE_SIZE). The caller promises not
473 * to touch memory outside the requested iova slice.
474 *
475 * FIXME: callers that need a DMA mapping via a sgl should create another
476 * interface to build the SGL efficiently
477 */
478 int iopt_access_pages(struct io_pagetable *iopt, unsigned long iova,
479 size_t length, struct page **out_pages, bool write)
480 {
481 unsigned long cur_iova = iova;
482 unsigned long last_iova;
483 struct iopt_area *area;
484 int rc;
485
486 if (!length)
487 return -EINVAL;
> 488 if (check_add_overflow(iova, length - 1, &last_iova))
489 return -EOVERFLOW;
490
491 down_read(&iopt->rwsem);
492 for (area = iopt_area_iter_first(iopt, iova, last_iova); area;
493 area = iopt_area_iter_next(area, iova, last_iova)) {
494 unsigned long last = min(last_iova, iopt_area_last_iova(area));
495 unsigned long last_index;
496 unsigned long index;
497
498 /* Need contiguous areas in the access */
499 if (iopt_area_iova(area) < cur_iova) {
500 rc = -EINVAL;
501 goto out_remove;
502 }
503
504 index = iopt_iova_to_index(area, cur_iova);
505 last_index = iopt_iova_to_index(area, last);
506 rc = iopt_pages_add_user(area->pages, index, last_index,
507 out_pages, write);
508 if (rc)
509 goto out_remove;
510 if (last == last_iova)
511 break;
512 /*
513 * Can't cross areas that are not aligned to the system page
514 * size with this API.
515 */
516 if (cur_iova % PAGE_SIZE) {
517 rc = -EINVAL;
518 goto out_remove;
519 }
520 cur_iova = last + 1;
521 out_pages += last_index - index;
522 atomic_inc(&area->num_users);
523 }
524
525 up_read(&iopt->rwsem);
526 return 0;
527
528 out_remove:
529 if (cur_iova != iova)
530 iopt_unaccess_pages(iopt, iova, cur_iova - iova);
531 return rc;
532 }
533
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH v5 10/22] virtio_pci: queue_reset: update struct virtio_pci_common_cfg and option functions
by kernel test robot
Hi Xuan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on mst-vhost/linux-next]
[also build test WARNING on horms-ipvs/master linus/master v5.17-rc4 next-20220214]
[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]
url: https://github.com/0day-ci/linux/commits/Xuan-Zhuo/virtio-pci-support-VIR...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: arc-randconfig-s031-20220213 (https://download.01.org/0day-ci/archive/20220214/202202142106.rh4tc9QS-lk...)
compiler: arc-elf-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/35ff048387e621104cc36bdebf89f325a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xuan-Zhuo/virtio-pci-support-VIRTIO_F_RING_RESET/20220214-161706
git checkout 35ff048387e621104cc36bdebf89f325a2c01370
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash drivers/virtio/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/virtio/virtio_pci_modern_dev.c:476:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/virtio/virtio_pci_modern_dev.c:476:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct virtio_pci_common_cfg_reset [noderef] __iomem *cfg @@ got struct virtio_pci_common_cfg_reset * @@
drivers/virtio/virtio_pci_modern_dev.c:476:13: sparse: expected struct virtio_pci_common_cfg_reset [noderef] __iomem *cfg
drivers/virtio/virtio_pci_modern_dev.c:476:13: sparse: got struct virtio_pci_common_cfg_reset *
drivers/virtio/virtio_pci_modern_dev.c:492:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/virtio/virtio_pci_modern_dev.c:492:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct virtio_pci_common_cfg_reset [noderef] __iomem *cfg @@ got struct virtio_pci_common_cfg_reset * @@
drivers/virtio/virtio_pci_modern_dev.c:492:13: sparse: expected struct virtio_pci_common_cfg_reset [noderef] __iomem *cfg
drivers/virtio/virtio_pci_modern_dev.c:492:13: sparse: got struct virtio_pci_common_cfg_reset *
vim +/__iomem +476 drivers/virtio/virtio_pci_modern_dev.c
466
467 /*
468 * vp_modern_get_queue_reset - get the queue reset status
469 * @mdev: the modern virtio-pci device
470 * @index: queue index
471 */
472 int vp_modern_get_queue_reset(struct virtio_pci_modern_device *mdev, u16 index)
473 {
474 struct virtio_pci_common_cfg_reset __iomem *cfg;
475
> 476 cfg = (struct virtio_pci_common_cfg_reset *)mdev->common;
477
478 vp_iowrite16(index, &cfg->cfg.queue_select);
479 return vp_ioread16(&cfg->queue_reset);
480 }
481 EXPORT_SYMBOL_GPL(vp_modern_get_queue_reset);
482
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
fs/dlm/midcomms.c:913:22: sparse: sparse: restricted __le32 degrades to integer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b57f458985742bd1c585f4c7f36d04634ce1143
commit: 658bd576f95ed597e519cdadf1c86ac87c17aea5 fs: dlm: move version conversion to compile time
date: 3 months ago
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220122/202201221028.YKA8kSdm-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 658bd576f95ed597e519cdadf1c86ac87c17aea5
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
fs/dlm/midcomms.c:213:1: sparse: sparse: symbol '__srcu_struct_nodes_srcu' was not declared. Should it be static?
fs/dlm/midcomms.c:570:25: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:678:19: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:680:16: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:718:27: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:737:25: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:747:25: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:756:23: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:766:42: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:769:26: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:804:23: sparse: sparse: cast to restricted __le32
fs/dlm/midcomms.c:838:27: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:898:26: sparse: sparse: cast to restricted __le16
fs/dlm/midcomms.c:920:25: sparse: sparse: cast to restricted __le32
>> fs/dlm/midcomms.c:913:22: sparse: sparse: restricted __le32 degrades to integer
fs/dlm/midcomms.c:916:22: sparse: sparse: restricted __le32 degrades to integer
fs/dlm/midcomms.c:1056:20: sparse: sparse: context imbalance in 'dlm_midcomms_get_mhandle' - wrong count at exit
fs/dlm/midcomms.c: note: in included file (through include/linux/notifier.h, arch/x86/include/asm/uprobes.h, include/linux/uprobes.h, ...):
include/linux/srcu.h:188:9: sparse: sparse: context imbalance in 'dlm_midcomms_commit_mhandle' - unexpected unlock
vim +913 fs/dlm/midcomms.c
871
872 /*
873 * Called from the low-level comms layer to process a buffer of
874 * commands.
875 */
876
877 int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int len)
878 {
879 const unsigned char *ptr = buf;
880 const struct dlm_header *hd;
881 uint16_t msglen;
882 int ret = 0;
883
884 while (len >= sizeof(struct dlm_header)) {
885 hd = (struct dlm_header *)ptr;
886
887 /* no message should be more than DLM_MAX_SOCKET_BUFSIZE or
888 * less than dlm_header size.
889 *
890 * Some messages does not have a 8 byte length boundary yet
891 * which can occur in a unaligned memory access of some dlm
892 * messages. However this problem need to be fixed at the
893 * sending side, for now it seems nobody run into architecture
894 * related issues yet but it slows down some processing.
895 * Fixing this issue should be scheduled in future by doing
896 * the next major version bump.
897 */
898 msglen = le16_to_cpu(hd->h_length);
899 if (msglen > DLM_MAX_SOCKET_BUFSIZE ||
900 msglen < sizeof(struct dlm_header)) {
901 log_print("received invalid length header: %u from node %d, will abort message parsing",
902 msglen, nodeid);
903 return -EBADMSG;
904 }
905
906 /* caller will take care that leftover
907 * will be parsed next call with more data
908 */
909 if (msglen > len)
910 break;
911
912 switch (hd->h_version) {
> 913 case cpu_to_le32(DLM_VERSION_3_1):
914 dlm_midcomms_receive_buffer_3_1((union dlm_packet *)ptr, nodeid);
915 break;
916 case cpu_to_le32(DLM_VERSION_3_2):
917 dlm_midcomms_receive_buffer_3_2((union dlm_packet *)ptr, nodeid);
918 break;
919 default:
920 log_print("received invalid version header: %u from node %d, will skip this message",
921 le32_to_cpu(hd->h_version), nodeid);
922 break;
923 }
924
925 ret += msglen;
926 len -= msglen;
927 ptr += msglen;
928 }
929
930 return ret;
931 }
932
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [RFC v2 5/5] drm/hdmi21: Add frl_dfm_helper to Makefile
by kernel test robot
Hi Vandita,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on drm/drm-next]
[also build test ERROR on drm-tip/drm-tip next-20220214]
[cannot apply to drm-intel/for-linux-next v5.17-rc4]
[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]
url: https://github.com/0day-ci/linux/commits/Vandita-Kulkarni/Add-data-flow-m...
base: git://anongit.freedesktop.org/drm/drm drm-next
config: x86_64-randconfig-a015-20220214 (https://download.01.org/0day-ci/archive/20220214/202202142054.QTxH42kQ-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/269e5e345603a732b79ed843bee22e262...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vandita-Kulkarni/Add-data-flow-metering-support-for-HDMI2-1/20220214-180307
git checkout 269e5e345603a732b79ed843bee22e26272790e5
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/drm_frl_dfm_helper.c: In function 'drm_frl_dfm_dsc_is_timing_req_met':
>> drivers/gpu/drm/drm_frl_dfm_helper.c:746:65: error: variable 'tblank_target_ns' set but not used [-Werror=unused-but-set-variable]
746 | unsigned int tactive_ref_ns, tblank_ref_ns, tactive_target_ns, tblank_target_ns;
| ^~~~~~~~~~~~~~~~
>> drivers/gpu/drm/drm_frl_dfm_helper.c:746:31: error: variable 'tblank_ref_ns' set but not used [-Werror=unused-but-set-variable]
746 | unsigned int tactive_ref_ns, tblank_ref_ns, tactive_target_ns, tblank_target_ns;
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/tblank_target_ns +746 drivers/gpu/drm/drm_frl_dfm_helper.c
b70ef83dc221893 Ankit Nautiyal 2022-02-14 740
b70ef83dc221893 Ankit Nautiyal 2022-02-14 741 /* Is DFM timing requirement is met with DSC */
b70ef83dc221893 Ankit Nautiyal 2022-02-14 742 static
b70ef83dc221893 Ankit Nautiyal 2022-02-14 743 bool drm_frl_dfm_dsc_is_timing_req_met(struct drm_hdmi_frl_dfm *frl_dfm)
b70ef83dc221893 Ankit Nautiyal 2022-02-14 744 {
b70ef83dc221893 Ankit Nautiyal 2022-02-14 745 unsigned int ftb_avg_k;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 @746 unsigned int tactive_ref_ns, tblank_ref_ns, tactive_target_ns, tblank_target_ns;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 747 unsigned int tb_borrowed, tb_delta, tb_worst;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 748
b70ef83dc221893 Ankit Nautiyal 2022-02-14 749 ftb_avg_k = drm_frl_dsc_get_ftb_avg(frl_dfm->params.hcactive_target,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 750 frl_dfm->params.hcblank_target,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 751 frl_dfm->config.hactive,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 752 frl_dfm->config.hblank,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 753 frl_dfm->params.pixel_clock_max_khz);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 754
b70ef83dc221893 Ankit Nautiyal 2022-02-14 755 tactive_ref_ns = drm_frl_dsc_get_tactive_ref_ns(frl_dfm->params.line_time_ns,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 756 frl_dfm->config.hactive,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 757 frl_dfm->config.hblank);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 758
b70ef83dc221893 Ankit Nautiyal 2022-02-14 759 tblank_ref_ns = drm_frl_dsc_get_tblank_ref_ns(frl_dfm->params.line_time_ns,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 760 frl_dfm->config.hactive,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 761 frl_dfm->config.hblank);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 762
b70ef83dc221893 Ankit Nautiyal 2022-02-14 763 tactive_target_ns = drm_frl_dsc_tactive_target_ns(frl_dfm->config.lanes,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 764 frl_dfm->params.hcactive_target,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 765 ftb_avg_k,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 766 frl_dfm->params.char_rate_min_kbps,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 767 frl_dfm->params.overhead_max);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 768
b70ef83dc221893 Ankit Nautiyal 2022-02-14 769 tblank_target_ns = frl_dfm->params.line_time_ns - tactive_target_ns;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 770
b70ef83dc221893 Ankit Nautiyal 2022-02-14 771 tb_borrowed = drm_frl_get_dsc_tri_bytes_borrowed(tactive_target_ns,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 772 ftb_avg_k,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 773 frl_dfm->params.hcactive_target);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 774
b70ef83dc221893 Ankit Nautiyal 2022-02-14 775 tb_delta = drm_frl_get_dsc_tri_bytes_delta(tactive_target_ns,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 776 tactive_ref_ns,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 777 frl_dfm->params.hcactive_target,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 778 ftb_avg_k,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 779 frl_dfm->config.hactive,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 780 frl_dfm->config.hblank,
b70ef83dc221893 Ankit Nautiyal 2022-02-14 781 frl_dfm->params.line_time_ns);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 782
b70ef83dc221893 Ankit Nautiyal 2022-02-14 783 tb_worst = max(tb_borrowed, tb_delta);
b70ef83dc221893 Ankit Nautiyal 2022-02-14 784 if (tb_worst > TB_BORROWED_MAX)
b70ef83dc221893 Ankit Nautiyal 2022-02-14 785 return false;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 786
b70ef83dc221893 Ankit Nautiyal 2022-02-14 787 frl_dfm->params.ftb_avg_k = ftb_avg_k;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 788 frl_dfm->params.tb_borrowed = tb_borrowed;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 789
b70ef83dc221893 Ankit Nautiyal 2022-02-14 790 return true;
b70ef83dc221893 Ankit Nautiyal 2022-02-14 791 }
b70ef83dc221893 Ankit Nautiyal 2022-02-14 792
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[willy-pagecache:for-next 57/85] mm/folio-compat.c:173:6: error: redefinition of 'mlock_vma_page'
by kernel test robot
tree: git://git.infradead.org/users/willy/pagecache for-next
head: c267b33d0001488f1d9dad12d6a87655e174d914
commit: 9f6308afc86e0291310d03238e80557983af6e40 [57/85] mm/mlock: Turn mlock_vma_page() into mlock_vma_folio()
config: h8300-alldefconfig (https://download.01.org/0day-ci/archive/20220214/202202142042.ZrGvsx6C-lk...)
compiler: h8300-linux-gcc (GCC) 11.2.0
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
git remote add willy-pagecache git://git.infradead.org/users/willy/pagecache
git fetch --no-tags willy-pagecache for-next
git checkout 9f6308afc86e0291310d03238e80557983af6e40
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
mm/folio-compat.c:168:6: warning: no previous prototype for 'clear_page_mlock' [-Wmissing-prototypes]
168 | void clear_page_mlock(struct page *page)
| ^~~~~~~~~~~~~~~~
>> mm/folio-compat.c:173:6: error: redefinition of 'mlock_vma_page'
173 | void mlock_vma_page(struct page *page)
| ^~~~~~~~~~~~~~
In file included from mm/folio-compat.c:10:
mm/internal.h:503:20: note: previous definition of 'mlock_vma_page' with type 'void(struct page *)'
503 | static inline void mlock_vma_page(struct page *page) { }
| ^~~~~~~~~~~~~~
mm/folio-compat.c: In function 'mlock_vma_page':
>> mm/folio-compat.c:175:9: error: implicit declaration of function 'mlock_vma_folio'; did you mean 'mlock_vma_page'? [-Werror=implicit-function-declaration]
175 | mlock_vma_folio(page_folio(page));
| ^~~~~~~~~~~~~~~
| mlock_vma_page
cc1: some warnings being treated as errors
vim +/mlock_vma_page +173 mm/folio-compat.c
172
> 173 void mlock_vma_page(struct page *page)
174 {
> 175 mlock_vma_folio(page_folio(page));
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[luxis1999-iommufd:iommufd-v5.17-rc1 29/29] drivers/iommu/iommufd/pages.c:482:2: error: implicit declaration of function 'kunmap_atomic'
by kernel test robot
tree: https://github.com/luxis1999/iommufd iommufd-v5.17-rc1
head: 0afc8638a638ddb14a59876ee72e869b770f4c02
commit: 0afc8638a638ddb14a59876ee72e869b770f4c02 [29/29] iommufd: Add device mmio map support
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220214/202202141921.KB6IvVIV-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
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/luxis1999/iommufd/commit/0afc8638a638ddb14a59876ee72e8...
git remote add luxis1999-iommufd https://github.com/luxis1999/iommufd
git fetch --no-tags luxis1999-iommufd iommufd-v5.17-rc1
git checkout 0afc8638a638ddb14a59876ee72e869b770f4c02
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/iommu/iommufd/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/iommu/iommufd/pages.c:482:2: error: implicit declaration of function 'kunmap_atomic' [-Werror,-Wimplicit-function-declaration]
pte_unmap_unlock(ptep, ptl);
^
include/linux/mm.h:2345:2: note: expanded from macro 'pte_unmap_unlock'
pte_unmap(pte); \
^
include/linux/pgtable.h:99:24: note: expanded from macro 'pte_unmap'
#define pte_unmap(pte) kunmap_atomic((pte))
^
1 error generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for IOMMUFD
Depends on IOMMU_SUPPORT
Selected by
- VFIO_PCI_CORE && VFIO && PCI && MMU
vim +/kunmap_atomic +482 drivers/iommu/iommufd/pages.c
449
450 static int follow_fault_pfn(struct vm_area_struct *vma, struct mm_struct *mm,
451 unsigned long vaddr, unsigned long *pfn,
452 bool write_fault)
453 {
454 pte_t *ptep;
455 spinlock_t *ptl;
456 int ret;
457
458 ret = follow_pte(vma->vm_mm, vaddr, &ptep, &ptl);
459 if (ret) {
460 bool unlocked = false;
461
462 ret = fixup_user_fault(mm, vaddr,
463 FAULT_FLAG_REMOTE |
464 (write_fault ? FAULT_FLAG_WRITE : 0),
465 &unlocked);
466 if (unlocked)
467 return -EAGAIN;
468
469 if (ret)
470 return ret;
471
472 ret = follow_pte(vma->vm_mm, vaddr, &ptep, &ptl);
473 if (ret)
474 return ret;
475 }
476
477 if (write_fault && !pte_write(*ptep))
478 ret = -EFAULT;
479 else
480 *pfn = pte_pfn(*ptep);
481
> 482 pte_unmap_unlock(ptep, ptl);
483 return ret;
484 }
485
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[linux-next:master 4050/5679] arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 259cbfc98c55ba3b6ef6e61fb7cfc3751dfded1e
commit: 9b106a9037d705d0c5cbc747b6fed7cbb33b0e00 [4050/5679] fortify: Detect struct member overflows in memcpy() at compile-time
config: powerpc-randconfig-s032-20220213 (https://download.01.org/0day-ci/archive/20220214/202202141923.LIhTJmFW-lk...)
compiler: powerpc-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 9b106a9037d705d0c5cbc747b6fed7cbb33b0e00
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/platforms/52xx/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
>> arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:133:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
>> arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: expected void *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:136:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
>> arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: got void [noderef] __iomem *irq_0x500
>> arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:155:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: got void [noderef] __iomem *irq_0x500
>> arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: expected void *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:156:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got void [noderef] __iomem *irq_0x500 @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: expected void *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:163:9: sparse: got void [noderef] __iomem *irq_0x500
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: expected void const *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got void [noderef] __iomem *static [assigned] [toplevel] sram @@
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: expected void *
arch/powerpc/platforms/52xx/mpc52xx_pm.c:176:9: sparse: got void [noderef] __iomem *static [assigned] [toplevel] sram
vim +133 arch/powerpc/platforms/52xx/mpc52xx_pm.c
2e1ee1f76684c5 Domen Puncer 2007-05-07 112
2e1ee1f76684c5 Domen Puncer 2007-05-07 113 int mpc52xx_pm_enter(suspend_state_t state)
2e1ee1f76684c5 Domen Puncer 2007-05-07 114 {
2e1ee1f76684c5 Domen Puncer 2007-05-07 115 u32 clk_enables;
2e1ee1f76684c5 Domen Puncer 2007-05-07 116 u32 msr, hid0;
2e1ee1f76684c5 Domen Puncer 2007-05-07 117 u32 intr_main_mask;
d3e0e02804a5f4 Domen Puncer 2007-07-09 118 void __iomem * irq_0x500 = (void __iomem *)CONFIG_KERNEL_START + 0x500;
2e1ee1f76684c5 Domen Puncer 2007-05-07 119 unsigned long irq_0x500_stop = (unsigned long)irq_0x500 + mpc52xx_ds_cached_size;
741c5640a15a23 Kees Cook 2018-07-02 120 char saved_0x500[0x600-0x500];
741c5640a15a23 Kees Cook 2018-07-02 121
741c5640a15a23 Kees Cook 2018-07-02 122 if (WARN_ON(mpc52xx_ds_cached_size > sizeof(saved_0x500)))
741c5640a15a23 Kees Cook 2018-07-02 123 return -ENOMEM;
2e1ee1f76684c5 Domen Puncer 2007-05-07 124
2e1ee1f76684c5 Domen Puncer 2007-05-07 125 /* disable all interrupts in PIC */
2e1ee1f76684c5 Domen Puncer 2007-05-07 126 intr_main_mask = in_be32(&intr->main_mask);
2e1ee1f76684c5 Domen Puncer 2007-05-07 127 out_be32(&intr->main_mask, intr_main_mask | 0x1ffff);
2e1ee1f76684c5 Domen Puncer 2007-05-07 128
2e1ee1f76684c5 Domen Puncer 2007-05-07 129 /* don't let DEC expire any time soon */
2e1ee1f76684c5 Domen Puncer 2007-05-07 130 mtspr(SPRN_DEC, 0x7fffffff);
2e1ee1f76684c5 Domen Puncer 2007-05-07 131
2e1ee1f76684c5 Domen Puncer 2007-05-07 132 /* save SRAM */
2e1ee1f76684c5 Domen Puncer 2007-05-07 @133 memcpy(saved_sram, sram, sram_size);
2e1ee1f76684c5 Domen Puncer 2007-05-07 134
2e1ee1f76684c5 Domen Puncer 2007-05-07 135 /* copy low level suspend code to sram */
2e1ee1f76684c5 Domen Puncer 2007-05-07 @136 memcpy(sram, mpc52xx_ds_sram, mpc52xx_ds_sram_size);
2e1ee1f76684c5 Domen Puncer 2007-05-07 137
2e1ee1f76684c5 Domen Puncer 2007-05-07 138 out_8(&cdm->ccs_sleep_enable, 1);
2e1ee1f76684c5 Domen Puncer 2007-05-07 139 out_8(&cdm->osc_sleep_enable, 1);
2e1ee1f76684c5 Domen Puncer 2007-05-07 140 out_8(&cdm->ccs_qreq_test, 1);
2e1ee1f76684c5 Domen Puncer 2007-05-07 141
2e1ee1f76684c5 Domen Puncer 2007-05-07 142 /* disable all but SDRAM and bestcomm (SRAM) clocks */
2e1ee1f76684c5 Domen Puncer 2007-05-07 143 clk_enables = in_be32(&cdm->clk_enables);
2e1ee1f76684c5 Domen Puncer 2007-05-07 144 out_be32(&cdm->clk_enables, clk_enables & 0x00088000);
2e1ee1f76684c5 Domen Puncer 2007-05-07 145
2e1ee1f76684c5 Domen Puncer 2007-05-07 146 /* disable power management */
2e1ee1f76684c5 Domen Puncer 2007-05-07 147 msr = mfmsr();
2e1ee1f76684c5 Domen Puncer 2007-05-07 148 mtmsr(msr & ~MSR_POW);
2e1ee1f76684c5 Domen Puncer 2007-05-07 149
2e1ee1f76684c5 Domen Puncer 2007-05-07 150 /* enable sleep mode, disable others */
2e1ee1f76684c5 Domen Puncer 2007-05-07 151 hid0 = mfspr(SPRN_HID0);
2e1ee1f76684c5 Domen Puncer 2007-05-07 152 mtspr(SPRN_HID0, (hid0 & ~(HID0_DOZE | HID0_NAP | HID0_DPM)) | HID0_SLEEP);
2e1ee1f76684c5 Domen Puncer 2007-05-07 153
2e1ee1f76684c5 Domen Puncer 2007-05-07 154 /* save original, copy our irq handler, flush from dcache and invalidate icache */
2e1ee1f76684c5 Domen Puncer 2007-05-07 @155 memcpy(saved_0x500, irq_0x500, mpc52xx_ds_cached_size);
2e1ee1f76684c5 Domen Puncer 2007-05-07 @156 memcpy(irq_0x500, mpc52xx_ds_cached, mpc52xx_ds_cached_size);
2e1ee1f76684c5 Domen Puncer 2007-05-07 157 flush_icache_range((unsigned long)irq_0x500, irq_0x500_stop);
2e1ee1f76684c5 Domen Puncer 2007-05-07 158
2e1ee1f76684c5 Domen Puncer 2007-05-07 159 /* call low-level sleep code */
2e1ee1f76684c5 Domen Puncer 2007-05-07 160 mpc52xx_deep_sleep(sram, sdram, cdm, intr);
2e1ee1f76684c5 Domen Puncer 2007-05-07 161
2e1ee1f76684c5 Domen Puncer 2007-05-07 162 /* restore original irq handler */
2e1ee1f76684c5 Domen Puncer 2007-05-07 163 memcpy(irq_0x500, saved_0x500, mpc52xx_ds_cached_size);
2e1ee1f76684c5 Domen Puncer 2007-05-07 164 flush_icache_range((unsigned long)irq_0x500, irq_0x500_stop);
2e1ee1f76684c5 Domen Puncer 2007-05-07 165
2e1ee1f76684c5 Domen Puncer 2007-05-07 166 /* restore old power mode */
2e1ee1f76684c5 Domen Puncer 2007-05-07 167 mtmsr(msr & ~MSR_POW);
2e1ee1f76684c5 Domen Puncer 2007-05-07 168 mtspr(SPRN_HID0, hid0);
2e1ee1f76684c5 Domen Puncer 2007-05-07 169 mtmsr(msr);
2e1ee1f76684c5 Domen Puncer 2007-05-07 170
2e1ee1f76684c5 Domen Puncer 2007-05-07 171 out_be32(&cdm->clk_enables, clk_enables);
2e1ee1f76684c5 Domen Puncer 2007-05-07 172 out_8(&cdm->ccs_sleep_enable, 0);
2e1ee1f76684c5 Domen Puncer 2007-05-07 173 out_8(&cdm->osc_sleep_enable, 0);
2e1ee1f76684c5 Domen Puncer 2007-05-07 174
2e1ee1f76684c5 Domen Puncer 2007-05-07 175 /* restore SRAM */
2e1ee1f76684c5 Domen Puncer 2007-05-07 176 memcpy(sram, saved_sram, sram_size);
2e1ee1f76684c5 Domen Puncer 2007-05-07 177
2e1ee1f76684c5 Domen Puncer 2007-05-07 178 /* reenable interrupts in PIC */
2e1ee1f76684c5 Domen Puncer 2007-05-07 179 out_be32(&intr->main_mask, intr_main_mask);
2e1ee1f76684c5 Domen Puncer 2007-05-07 180
2e1ee1f76684c5 Domen Puncer 2007-05-07 181 return 0;
2e1ee1f76684c5 Domen Puncer 2007-05-07 182 }
2e1ee1f76684c5 Domen Puncer 2007-05-07 183
:::::: The code at line 133 was first introduced by commit
:::::: 2e1ee1f76684c5d4dd8e5a08cbf22d57f88769ed [POWERPC] mpc52xx suspend to deep-sleep
:::::: TO: Domen Puncer <domen.puncer(a)telargo.com>
:::::: CC: Paul Mackerras <paulus(a)samba.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week