[xhci:rewrite_invalid_context_at_stop_endpoint 6/6] drivers/usb/host/xhci-ring.c:727:19: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'dma_addr_t' {aka 'unsigned int'}
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git rewrite_invalid_context_at_stop_endpoint
head: a09f431166ed310e82b5ee4a03d493ec1d76d75a
commit: a09f431166ed310e82b5ee4a03d493ec1d76d75a [6/6] xhci: introduce a new move_dequeue_past_td() function to replace old code.
config: microblaze-randconfig-r004-20201014 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.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
# https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/commit/?i...
git remote add xhci https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git
git fetch --no-tags xhci rewrite_invalid_context_at_stop_endpoint
git checkout a09f431166ed310e82b5ee4a03d493ec1d76d75a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
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 >>):
drivers/usb/host/xhci-ring.c:635:5: warning: no previous prototype for 'xhci_move_dequeue_past_td' [-Wmissing-prototypes]
635 | int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/usb/host/xhci-ring.c:57:
drivers/usb/host/xhci-ring.c: In function 'xhci_move_dequeue_past_td':
>> drivers/usb/host/xhci-ring.c:727:19: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
727 | xhci_warn(xhci, "WARN Can't submit Set TR Deq 0x%llx\n", addr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/usb/host/xhci.h:1950:2: note: in expansion of macro 'dev_warn'
1950 | dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
| ^~~~~~~~
drivers/usb/host/xhci-ring.c:727:3: note: in expansion of macro 'xhci_warn'
727 | xhci_warn(xhci, "WARN Can't submit Set TR Deq 0x%llx\n", addr);
| ^~~~~~~~~
drivers/usb/host/xhci-ring.c:727:54: note: format string is defined here
727 | xhci_warn(xhci, "WARN Can't submit Set TR Deq 0x%llx\n", addr);
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/usb/host/xhci-ring.c:57:
drivers/usb/host/xhci-ring.c:735:19: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
735 | xhci_warn(xhci, "WARN Fail to allocate Set TR Deq cmd 0x%llx\n", addr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/usb/host/xhci.h:1950:2: note: in expansion of macro 'dev_warn'
1950 | dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
| ^~~~~~~~
drivers/usb/host/xhci-ring.c:735:3: note: in expansion of macro 'xhci_warn'
735 | xhci_warn(xhci, "WARN Fail to allocate Set TR Deq cmd 0x%llx\n", addr);
| ^~~~~~~~~
drivers/usb/host/xhci-ring.c:735:62: note: format string is defined here
735 | xhci_warn(xhci, "WARN Fail to allocate Set TR Deq cmd 0x%llx\n", addr);
| ~~~^
| |
| long long unsigned int
| %x
vim +727 drivers/usb/host/xhci-ring.c
634
635 int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
636 unsigned int slot_id, unsigned int ep_index,
637 unsigned int stream_id, struct xhci_td *td)
638 {
639 struct xhci_virt_device *dev = xhci->devs[slot_id];
640 struct xhci_virt_ep *ep = &dev->eps[ep_index];
641 struct xhci_ring *ep_ring;
642 struct xhci_command *cmd;
643 struct xhci_segment *new_seg;
644 union xhci_trb *new_deq;
645 int new_cycle;
646 dma_addr_t addr;
647 u64 hw_dequeue;
648 bool cycle_found = false;
649 bool td_last_trb_found = false;
650 u32 trb_sct = 0;
651 int ret;
652
653 ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id,
654 ep_index, stream_id);
655 if (!ep_ring) {
656 xhci_warn(xhci, "WARN can't find new dequeue state "
657 "for invalid stream ID %u.\n",
658 stream_id);
659 return -ENODEV;
660 }
661 /*
662 * A cancelled TD can complete with a stall if HW cached the trb.
663 * In this case driver can't find td, but if the ring is empty we
664 * can move the dequeue pointer to the current enqueue position.
665 * FIXMA MATTU is this still the case?
666 */
667 if (!td) {
668 if (list_empty(&ep_ring->td_list)) {
669 new_seg = ep_ring->enq_seg;
670 new_deq = ep_ring->enqueue;
671 new_cycle = ep_ring->cycle_state;
672 xhci_dbg(xhci, "ep ring empty, Set new dequeue = enqueue");
673 goto deq_found;
674 } else {
675 xhci_warn(xhci, "Can't find new dequeue state, missing td\n");
676 return -EINVAL;
677 }
678 }
679
680 hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
681 new_seg = ep_ring->deq_seg;
682 new_deq = ep_ring->dequeue;
683 new_cycle = hw_dequeue & 0x1;
684
685 /*
686 * We want to find the pointer, segment and cycle state of the new trb
687 * (the one after current TD's last_trb). We know the cycle state at
688 * hw_dequeue, so walk the ring until both hw_dequeue and last_trb are
689 * found.
690 */
691 do {
692 if (!cycle_found && xhci_trb_virt_to_dma(new_seg, new_deq)
693 == (dma_addr_t)(hw_dequeue & ~0xf)) {
694 cycle_found = true;
695 if (td_last_trb_found)
696 break;
697 }
698 if (new_deq == td->last_trb)
699 td_last_trb_found = true;
700
701 if (cycle_found && trb_is_link(new_deq) &&
702 link_trb_toggles_cycle(new_deq))
703 new_cycle ^= 0x1;
704
705 next_trb(xhci, ep_ring, &new_seg, &new_deq);
706
707 /* Search wrapped around, bail out */
708 if (new_deq == ep->ring->dequeue) {
709 xhci_err(xhci, "Error: Failed finding new dequeue state\n");
710 return -EINVAL;
711 }
712
713 } while (!cycle_found || !td_last_trb_found);
714
715 deq_found:
716
717 /* Don't update the ring cycle state for the producer (us). */
718 addr = xhci_trb_virt_to_dma(new_seg, new_deq);
719 if (addr == 0) {
720 xhci_warn(xhci, "WARN Cannot find dma of new dequeue ptr\n");
721 xhci_warn(xhci, "deq seg = %p, deq ptr = %p\n", new_seg, new_deq);
722 return -EINVAL;
723 }
724
725 /* MATTU fixme do we want this PENDING flag at all?*/
726 if ((ep->ep_state & SET_DEQ_PENDING)) {
> 727 xhci_warn(xhci, "WARN Can't submit Set TR Deq 0x%llx\n", addr);
728 xhci_warn(xhci, "Another Set TR Deq command is pending.\n");
729 return -EBUSY; //MATTU FIXME
730 }
731
732 /* This function gets called from contexts where it cannot sleep */
733 cmd = xhci_alloc_command(xhci, false, GFP_ATOMIC);
734 if (!cmd) {
735 xhci_warn(xhci, "WARN Fail to allocate Set TR Deq cmd 0x%llx\n", addr);
736 return -ENOMEM;
737 }
738
739 if (stream_id)
740 trb_sct = SCT_FOR_TRB(SCT_PRI_TR);
741 ret = queue_command(xhci, cmd,
742 lower_32_bits(addr) | trb_sct | new_cycle,
743 upper_32_bits(addr),
744 STREAM_ID_FOR_TRB(stream_id), SLOT_ID_FOR_TRB(slot_id) |
745 EP_ID_FOR_TRB(ep_index) | TRB_TYPE(TRB_SET_DEQ), false);
746 if (ret < 0) {
747 xhci_free_command(xhci, cmd);
748 return ret;
749 }
750
751 ep->queued_deq_seg = new_seg;
752 ep->queued_deq_ptr = new_deq;
753
754 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
755 "Set TR Deq ptr 0x%llx, cycle %u\n", addr, new_cycle);
756
757 /* Stop the TD queueing code from ringing the doorbell until
758 * this command completes. The HC won't set the dequeue pointer
759 * if the ring is running, and ringing the doorbell starts the
760 * ring running.
761 */
762 ep->ep_state |= SET_DEQ_PENDING;
763 return 0;
764 }
765
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
[block:tif-task_work.arch 8/33] arch/arm/kernel/entry-v7m.S:62: Error: invalid constant (10f) after fixup
by kernel test robot
Hi Jens,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git tif-task_work.arch
head: df3eeaa049d6347afea574ca690e09a915dc2f0d
commit: a31cd8c020df3247ecfc89188fca4e24c5fc9442 [8/33] arm: add support for TIF_NOTIFY_SIGNAL
config: arm-randconfig-r005-20201014 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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
# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/com...
git remote add block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags block tif-task_work.arch
git checkout a31cd8c020df3247ecfc89188fca4e24c5fc9442
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
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 >>):
arch/arm/kernel/entry-v7m.S: Assembler messages:
>> arch/arm/kernel/entry-v7m.S:62: Error: invalid constant (10f) after fixup
vim +62 arch/arm/kernel/entry-v7m.S
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 34
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 35 .align 2
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 36 __irq_entry:
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 37 v7m_exception_entry
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 38
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 39 @
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 40 @ Invoke the IRQ handler
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 41 @
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 42 mrs r0, ipsr
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 43 ldr r1, =V7M_xPSR_EXCEPTIONNO
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 44 and r0, r1
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 45 sub r0, #16
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 46 mov r1, sp
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 47 stmdb sp!, {lr}
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 48 @ routine called with r0 = irq number, r1 = struct pt_regs *
bed859c1eea89f Uwe Kleine-König 2013-07-30 49 bl nvic_handle_irq
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 50
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 51 pop {lr}
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 52 @
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 53 @ Check for any pending work if returning to user
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 54 @
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 55 ldr r1, =BASEADDR_V7M_SCB
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 56 ldr r0, [r1, V7M_SCB_ICSR]
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 57 tst r0, V7M_SCB_ICSR_RETTOBASE
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 58 beq 2f
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 59
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 60 get_thread_info tsk
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 61 ldr r2, [tsk, #TI_FLAGS]
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 @62 tst r2, #_TIF_WORK_MASK
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 63 beq 2f @ no work pending
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 64 mov r0, #V7M_SCB_ICSR_PENDSVSET
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 65 str r0, [r1, V7M_SCB_ICSR] @ raise PendSV
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 66
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 67 2:
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 68 @ registers r0-r3 and r12 are automatically restored on exception
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 69 @ return. r4-r7 were not clobbered in v7m_exception_entry so for
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 70 @ correctness they don't need to be restored. So only r8-r11 must be
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 71 @ restored here. The easiest way to do so is to restore r0-r7, too.
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 72 ldmia sp!, {r0-r11}
5745eef6b81319 Russell King 2016-05-10 73 add sp, #PT_REGS_SIZE-S_IP
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 74 cpsie i
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 75 bx lr
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 76 ENDPROC(__irq_entry)
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 77
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 78 __pendsv_entry:
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 79 v7m_exception_entry
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 80
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 81 ldr r1, =BASEADDR_V7M_SCB
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 82 mov r0, #V7M_SCB_ICSR_PENDSVCLR
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 83 str r0, [r1, V7M_SCB_ICSR] @ clear PendSV
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 84
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 85 @ execute the pending work, including reschedule
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 86 get_thread_info tsk
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 87 mov why, #0
440ee365d30adb Ezequiel Garcia 2015-10-30 88 b ret_to_user_from_irq
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 89 ENDPROC(__pendsv_entry)
19c4d593f0b4bd Uwe Kleine-König 2010-05-21 90
:::::: The code at line 62 was first introduced by commit
:::::: 19c4d593f0b4bd46f6d923a3e514719982a22058 ARM: ARMv7-M: Add support for exception handling
:::::: TO: Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
:::::: CC: Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
[xhci:rewrite_invalid_context_at_stop_endpoint 6/6] drivers/usb/host/xhci-ring.c:635:5: warning: no previous prototype for 'xhci_move_dequeue_past_td'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git rewrite_invalid_context_at_stop_endpoint
head: a09f431166ed310e82b5ee4a03d493ec1d76d75a
commit: a09f431166ed310e82b5ee4a03d493ec1d76d75a [6/6] xhci: introduce a new move_dequeue_past_td() function to replace old code.
config: mips-randconfig-r002-20201014 (attached as .config)
compiler: mips64el-linux-gcc (GCC) 9.3.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
# https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/commit/?i...
git remote add xhci https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git
git fetch --no-tags xhci rewrite_invalid_context_at_stop_endpoint
git checkout a09f431166ed310e82b5ee4a03d493ec1d76d75a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
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 >>):
>> drivers/usb/host/xhci-ring.c:635:5: warning: no previous prototype for 'xhci_move_dequeue_past_td' [-Wmissing-prototypes]
635 | int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +/xhci_move_dequeue_past_td +635 drivers/usb/host/xhci-ring.c
634
> 635 int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
636 unsigned int slot_id, unsigned int ep_index,
637 unsigned int stream_id, struct xhci_td *td)
638 {
639 struct xhci_virt_device *dev = xhci->devs[slot_id];
640 struct xhci_virt_ep *ep = &dev->eps[ep_index];
641 struct xhci_ring *ep_ring;
642 struct xhci_command *cmd;
643 struct xhci_segment *new_seg;
644 union xhci_trb *new_deq;
645 int new_cycle;
646 dma_addr_t addr;
647 u64 hw_dequeue;
648 bool cycle_found = false;
649 bool td_last_trb_found = false;
650 u32 trb_sct = 0;
651 int ret;
652
653 ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id,
654 ep_index, stream_id);
655 if (!ep_ring) {
656 xhci_warn(xhci, "WARN can't find new dequeue state "
657 "for invalid stream ID %u.\n",
658 stream_id);
659 return -ENODEV;
660 }
661 /*
662 * A cancelled TD can complete with a stall if HW cached the trb.
663 * In this case driver can't find td, but if the ring is empty we
664 * can move the dequeue pointer to the current enqueue position.
665 * FIXMA MATTU is this still the case?
666 */
667 if (!td) {
668 if (list_empty(&ep_ring->td_list)) {
669 new_seg = ep_ring->enq_seg;
670 new_deq = ep_ring->enqueue;
671 new_cycle = ep_ring->cycle_state;
672 xhci_dbg(xhci, "ep ring empty, Set new dequeue = enqueue");
673 goto deq_found;
674 } else {
675 xhci_warn(xhci, "Can't find new dequeue state, missing td\n");
676 return -EINVAL;
677 }
678 }
679
680 hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
681 new_seg = ep_ring->deq_seg;
682 new_deq = ep_ring->dequeue;
683 new_cycle = hw_dequeue & 0x1;
684
685 /*
686 * We want to find the pointer, segment and cycle state of the new trb
687 * (the one after current TD's last_trb). We know the cycle state at
688 * hw_dequeue, so walk the ring until both hw_dequeue and last_trb are
689 * found.
690 */
691 do {
692 if (!cycle_found && xhci_trb_virt_to_dma(new_seg, new_deq)
693 == (dma_addr_t)(hw_dequeue & ~0xf)) {
694 cycle_found = true;
695 if (td_last_trb_found)
696 break;
697 }
698 if (new_deq == td->last_trb)
699 td_last_trb_found = true;
700
701 if (cycle_found && trb_is_link(new_deq) &&
702 link_trb_toggles_cycle(new_deq))
703 new_cycle ^= 0x1;
704
705 next_trb(xhci, ep_ring, &new_seg, &new_deq);
706
707 /* Search wrapped around, bail out */
708 if (new_deq == ep->ring->dequeue) {
709 xhci_err(xhci, "Error: Failed finding new dequeue state\n");
710 return -EINVAL;
711 }
712
713 } while (!cycle_found || !td_last_trb_found);
714
715 deq_found:
716
717 /* Don't update the ring cycle state for the producer (us). */
718 addr = xhci_trb_virt_to_dma(new_seg, new_deq);
719 if (addr == 0) {
720 xhci_warn(xhci, "WARN Cannot find dma of new dequeue ptr\n");
721 xhci_warn(xhci, "deq seg = %p, deq ptr = %p\n", new_seg, new_deq);
722 return -EINVAL;
723 }
724
725 /* MATTU fixme do we want this PENDING flag at all?*/
726 if ((ep->ep_state & SET_DEQ_PENDING)) {
727 xhci_warn(xhci, "WARN Can't submit Set TR Deq 0x%llx\n", addr);
728 xhci_warn(xhci, "Another Set TR Deq command is pending.\n");
729 return -EBUSY; //MATTU FIXME
730 }
731
732 /* This function gets called from contexts where it cannot sleep */
733 cmd = xhci_alloc_command(xhci, false, GFP_ATOMIC);
734 if (!cmd) {
735 xhci_warn(xhci, "WARN Fail to allocate Set TR Deq cmd 0x%llx\n", addr);
736 return -ENOMEM;
737 }
738
739 if (stream_id)
740 trb_sct = SCT_FOR_TRB(SCT_PRI_TR);
741 ret = queue_command(xhci, cmd,
742 lower_32_bits(addr) | trb_sct | new_cycle,
743 upper_32_bits(addr),
744 STREAM_ID_FOR_TRB(stream_id), SLOT_ID_FOR_TRB(slot_id) |
745 EP_ID_FOR_TRB(ep_index) | TRB_TYPE(TRB_SET_DEQ), false);
746 if (ret < 0) {
747 xhci_free_command(xhci, cmd);
748 return ret;
749 }
750
751 ep->queued_deq_seg = new_seg;
752 ep->queued_deq_ptr = new_deq;
753
754 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
755 "Set TR Deq ptr 0x%llx, cycle %u\n", addr, new_cycle);
756
757 /* Stop the TD queueing code from ringing the doorbell until
758 * this command completes. The HC won't set the dequeue pointer
759 * if the ring is running, and ringing the doorbell starts the
760 * ring running.
761 */
762 ep->ep_state |= SET_DEQ_PENDING;
763 return 0;
764 }
765
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
[rcar:vsp1/pa-phase 7/7] drivers/media/i2c/imx135.c:1246:26: error: storage size of 'dep_devices' isn't known
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git vsp1/pa-phase
head: d2606552ddb7871f0dd703f3655dec6bd7482407
commit: d2606552ddb7871f0dd703f3655dec6bd7482407 [7/7] imx135 camera sensor driver
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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
# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/...
git remote add rcar https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git fetch --no-tags rcar vsp1/pa-phase
git checkout d2606552ddb7871f0dd703f3655dec6bd7482407
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32
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/media/i2c/imx135.c: In function 'imx135_power_on':
>> drivers/media/i2c/imx135.c:1246:26: error: storage size of 'dep_devices' isn't known
1246 | struct acpi_handle_list dep_devices;
| ^~~~~~~~~~~
>> drivers/media/i2c/imx135.c:1251:6: error: implicit declaration of function 'acpi_has_method'; did you mean 'acpi_has_watchdog'? [-Werror=implicit-function-declaration]
1251 | if (acpi_has_method(dev_handle, "_DEP")) {
| ^~~~~~~~~~~~~~~
| acpi_has_watchdog
>> drivers/media/i2c/imx135.c:1252:12: error: implicit declaration of function 'acpi_evaluate_reference'; did you mean 'acpi_evaluate_object'? [-Werror=implicit-function-declaration]
1252 | status = acpi_evaluate_reference(dev_handle, "_DEP", NULL,
| ^~~~~~~~~~~~~~~~~~~~~~~
| acpi_evaluate_object
>> drivers/media/i2c/imx135.c:1271:9: error: implicit declaration of function 'acpi_bus_get_device'; did you mean 'acpi_get_gpe_device'? [-Werror=implicit-function-declaration]
1271 | if (acpi_bus_get_device(dep_devices.handles[i], &device))
| ^~~~~~~~~~~~~~~~~~~
| acpi_get_gpe_device
>> drivers/media/i2c/imx135.c:1274:28: error: 'platform_bus_type' undeclared (first use in this function)
1274 | dev = bus_find_device(&platform_bus_type, NULL,
| ^~~~~~~~~~~~~~~~~
drivers/media/i2c/imx135.c:1274:28: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/media/i2c/imx135.c:1275:14: error: dereferencing pointer to incomplete type 'struct acpi_device'
1275 | &device->fwnode, match_depend);
| ^~
drivers/media/i2c/imx135.c:1246:26: warning: unused variable 'dep_devices' [-Wunused-variable]
1246 | struct acpi_handle_list dep_devices;
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
vim +1246 drivers/media/i2c/imx135.c
1239
1240 static int imx135_power_on(struct device *dev)
1241 {
1242 struct i2c_client *client = to_i2c_client(dev);
1243 struct v4l2_subdev *sd = i2c_get_clientdata(client);
1244 struct imx135 *imx135 = to_imx135(sd);
1245 struct acpi_handle *dev_handle = ACPI_HANDLE(&client->dev);
> 1246 struct acpi_handle_list dep_devices;
1247 acpi_status status;
1248 int ret;
1249 int i;
1250
> 1251 if (acpi_has_method(dev_handle, "_DEP")) {
> 1252 status = acpi_evaluate_reference(dev_handle, "_DEP", NULL,
1253 &dep_devices);
1254 if (ACPI_FAILURE(status)) {
1255 printk("Failed to evaluate _DEP.\n");
1256 return -ENODEV;
1257 }
1258
1259 for (i = 0; i < dep_devices.count; i++) {
1260 struct acpi_device *device;
1261 struct acpi_device_info *info;
1262
1263 status = acpi_get_object_info(dep_devices.handles[i], &info);
1264 if (ACPI_FAILURE(status)) {
1265 printk("Error reading _DEP device info\n");
1266 return -ENODEV;
1267 }
1268
1269 if (info->valid & ACPI_VALID_HID &&
1270 !strcmp(info->hardware_id.string, "INT3472")) {
> 1271 if (acpi_bus_get_device(dep_devices.handles[i], &device))
1272 return -ENODEV;
1273
> 1274 dev = bus_find_device(&platform_bus_type, NULL,
> 1275 &device->fwnode, match_depend);
1276 if (dev) {
1277 dev_info(&client->dev, "Dependent platform device found %s\n",
1278 dev_name(dev));
1279 break;
1280 }
1281 }
1282 }
1283 }
1284
1285 ret = regulator_bulk_enable(IMX135_NUM_SUPPLIES, imx135->supplies);
1286 if (ret) {
1287 dev_err(imx135->dev, "Failed to enable regulators\n");
1288 return ret;
1289 }
1290
1291 usleep_range(1, 2);
1292 gpiod_set_value_cansleep(imx135->rst_gpio, 1);
1293 usleep_range(30000, 31000);
1294
1295 return 0;
1296 }
1297
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
Re: [patch 06/12] usb: host: isp1362: Replace in_interrupt() usage
by kernel test robot
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb-serial/usb-next balbi-usb/testing/next v5.9 next-20201013]
[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/Thomas-Gleixner/UBS-Cleanup-in_i...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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
# https://github.com/0day-ci/linux/commit/ee4d0a1f1ad7068ce381fd87cac015b76...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Gleixner/UBS-Cleanup-in_interupt-in_irq-in_atomic-usage/20201014-232156
git checkout ee4d0a1f1ad7068ce381fd87cac015b76b77de60
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
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 >>):
In file included from include/linux/printk.h:405,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/usb/host/isp1362-hcd.c:63:
drivers/usb/host/isp1362.h: In function 'isp1362_show_regs':
>> drivers/usb/host/isp1362.h:799:19: error: 'isp1362_hcd' undeclared (first use in this function)
799 | isp1362_show_reg(isp1362_hcd, HCREVISION);
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt, __dynamic_pr_debug, \
| ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:420:2: note: in expansion of macro 'dynamic_pr_debug'
420 | dynamic_pr_debug(fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~
drivers/usb/host/isp1362.h:543:4: note: in expansion of macro 'pr_debug'
543 | pr_debug(fmt); \
| ^~~~~~~~
drivers/usb/host/isp1362.h:789:3: note: in expansion of macro 'DBG'
789 | DBG(0, "%-12s[%02x]: %08x\n", #r, \
| ^~~
drivers/usb/host/isp1362.h:790:37: note: in expansion of macro 'isp1362_read_reg32'
790 | ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg32(d, r)); \
| ^~~~~~~~~~~~~~~~~~
drivers/usb/host/isp1362.h:799:2: note: in expansion of macro 'isp1362_show_reg'
799 | isp1362_show_reg(isp1362_hcd, HCREVISION);
| ^~~~~~~~~~~~~~~~
drivers/usb/host/isp1362.h:799:19: note: each undeclared identifier is reported only once for each function it appears in
799 | isp1362_show_reg(isp1362_hcd, HCREVISION);
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 | _dynamic_func_call(fmt, __dynamic_pr_debug, \
| ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:420:2: note: in expansion of macro 'dynamic_pr_debug'
420 | dynamic_pr_debug(fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~
drivers/usb/host/isp1362.h:543:4: note: in expansion of macro 'pr_debug'
543 | pr_debug(fmt); \
| ^~~~~~~~
drivers/usb/host/isp1362.h:789:3: note: in expansion of macro 'DBG'
789 | DBG(0, "%-12s[%02x]: %08x\n", #r, \
| ^~~
drivers/usb/host/isp1362.h:790:37: note: in expansion of macro 'isp1362_read_reg32'
790 | ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg32(d, r)); \
| ^~~~~~~~~~~~~~~~~~
drivers/usb/host/isp1362.h:799:2: note: in expansion of macro 'isp1362_show_reg'
799 | isp1362_show_reg(isp1362_hcd, HCREVISION);
| ^~~~~~~~~~~~~~~~
vim +/isp1362_hcd +799 drivers/usb/host/isp1362.h
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 795
ee4d0a1f1ad7068 Thomas Gleixner 2020-10-14 796 static void __attribute__((__unused__))
ee4d0a1f1ad7068 Thomas Gleixner 2020-10-14 797 isp1362_show_regs(struct isp1362_hcd *isp1362_hc, bool cached_inten)
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 798 {
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 @799 isp1362_show_reg(isp1362_hcd, HCREVISION);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 800 isp1362_show_reg(isp1362_hcd, HCCONTROL);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 801 isp1362_show_reg(isp1362_hcd, HCCMDSTAT);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 802 isp1362_show_reg(isp1362_hcd, HCINTSTAT);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 803 isp1362_show_reg(isp1362_hcd, HCINTENB);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 804 isp1362_show_reg(isp1362_hcd, HCFMINTVL);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 805 isp1362_show_reg(isp1362_hcd, HCFMREM);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 806 isp1362_show_reg(isp1362_hcd, HCFMNUM);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 807 isp1362_show_reg(isp1362_hcd, HCLSTHRESH);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 808 isp1362_show_reg(isp1362_hcd, HCRHDESCA);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 809 isp1362_show_reg(isp1362_hcd, HCRHDESCB);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 810 isp1362_show_reg(isp1362_hcd, HCRHSTATUS);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 811 isp1362_show_reg(isp1362_hcd, HCRHPORT1);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 812 isp1362_show_reg(isp1362_hcd, HCRHPORT2);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 813
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 814 isp1362_show_reg(isp1362_hcd, HCHWCFG);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 815 isp1362_show_reg(isp1362_hcd, HCDMACFG);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 816 isp1362_show_reg(isp1362_hcd, HCXFERCTR);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 817 isp1362_show_reg(isp1362_hcd, HCuPINT);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 818
ee4d0a1f1ad7068 Thomas Gleixner 2020-10-14 819 if (cached_inten)
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 820 DBG(0, "%-12s[%02x]: %04x\n", "HCuPINTENB",
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 821 ISP1362_REG_NO(ISP1362_REG_HCuPINTENB), isp1362_hcd->irqenb);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 822 else
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 823 isp1362_show_reg(isp1362_hcd, HCuPINTENB);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 824 isp1362_show_reg(isp1362_hcd, HCCHIPID);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 825 isp1362_show_reg(isp1362_hcd, HCSCRATCH);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 826 isp1362_show_reg(isp1362_hcd, HCBUFSTAT);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 827 isp1362_show_reg(isp1362_hcd, HCDIRADDR);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 828 /* Access would advance fifo
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 829 * isp1362_show_reg(isp1362_hcd, HCDIRDATA);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 830 */
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 831 isp1362_show_reg(isp1362_hcd, HCISTLBUFSZ);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 832 isp1362_show_reg(isp1362_hcd, HCISTLRATE);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 833 isp1362_show_reg(isp1362_hcd, HCINTLBUFSZ);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 834 isp1362_show_reg(isp1362_hcd, HCINTLBLKSZ);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 835 isp1362_show_reg(isp1362_hcd, HCINTLDONE);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 836 isp1362_show_reg(isp1362_hcd, HCINTLSKIP);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 837 isp1362_show_reg(isp1362_hcd, HCINTLLAST);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 838 isp1362_show_reg(isp1362_hcd, HCINTLCURR);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 839 isp1362_show_reg(isp1362_hcd, HCATLBUFSZ);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 840 isp1362_show_reg(isp1362_hcd, HCATLBLKSZ);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 841 /* only valid after ATL_DONE interrupt
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 842 * isp1362_show_reg(isp1362_hcd, HCATLDONE);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 843 */
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 844 isp1362_show_reg(isp1362_hcd, HCATLSKIP);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 845 isp1362_show_reg(isp1362_hcd, HCATLLAST);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 846 isp1362_show_reg(isp1362_hcd, HCATLCURR);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 847 isp1362_show_reg(isp1362_hcd, HCATLDTC);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 848 isp1362_show_reg(isp1362_hcd, HCATLDTCTO);
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 849 }
a9d43091c5be1e7 Lothar Wassmann 2009-07-16 850
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
Re: [PATCH] IPv6: sr: Fix End.X nexthop to use oif.
by kernel test robot
Hi Reji,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.9 next-20201013]
[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/Reji-Thomas/IPv6-sr-Fix-End-X-ne...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 865c50e1d279671728c2936cb7680eb89355eeea
config: riscv-randconfig-r035-20201014 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project e7fe3c6dfede8d5781bd000741c3dea7088307a4)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/8d40085b9b014197ce7a7e8927730796b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Reji-Thomas/IPv6-sr-Fix-End-X-nexthop-to-use-oif/20201013-204935
git checkout 8d40085b9b014197ce7a7e8927730796bf50adb0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
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 >>):
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:556:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inb(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:54:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:87:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:88:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:58:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from net/ipv6/seg6_local.c:11:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:148:
include/asm-generic/io.h:1017:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> net/ipv6/seg6_local.c:222:5: warning: no previous prototype for function 'seg6_strict_lookup_nexthop' [-Wmissing-prototypes]
int seg6_strict_lookup_nexthop(struct sk_buff *skb,
^
net/ipv6/seg6_local.c:222:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int seg6_strict_lookup_nexthop(struct sk_buff *skb,
^
static
8 warnings generated.
vim +/seg6_strict_lookup_nexthop +222 net/ipv6/seg6_local.c
221
> 222 int seg6_strict_lookup_nexthop(struct sk_buff *skb,
223 struct in6_addr *nhaddr, int oif, u32 tbl_id)
224 {
225 return seg6_lookup_any_nexthop(skb, nhaddr, oif, tbl_id, false);
226 }
227
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
Re: [PATCH 2/3] megaraid_sas: iouring iopoll support
by kernel test robot
Hi Kashyap,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20201013]
[cannot apply to scsi/for-next mkp-scsi/for-next v5.9 v5.9-rc8 v5.9-rc7 v5.9]
[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/Kashyap-Desai/add-io_uring-with-...
base: f2fb1afc57304f9dd68c20a08270e287470af2eb
config: x86_64-randconfig-a004-20201014 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project e7fe3c6dfede8d5781bd000741c3dea7088307a4)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/4f93510c3e695f6f22822115f6587db68...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kashyap-Desai/add-io_uring-with-IOPOLL-support-in-scsi-layer/20201014-202916
git checkout 4f93510c3e695f6f22822115f6587db68fb40e5c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
>> drivers/scsi/megaraid/megaraid_sas_fusion.c:3652:5: warning: no previous prototype for function 'megasas_blk_mq_poll' [-Wmissing-prototypes]
int megasas_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
^
drivers/scsi/megaraid/megaraid_sas_fusion.c:3652:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int megasas_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
^
static
1 warning generated.
vim +/megasas_blk_mq_poll +3652 drivers/scsi/megaraid/megaraid_sas_fusion.c
3651
> 3652 int megasas_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
3653 {
3654
3655 struct megasas_instance *instance;
3656 int num_entries = 0;
3657 struct fusion_context *fusion;
3658
3659 instance = (struct megasas_instance *)shost->hostdata;
3660
3661 fusion = instance->ctrl_context;
3662
3663 queue_num = queue_num + instance->low_latency_index_start;
3664
3665 if (!atomic_add_unless(&fusion->busy_mq_poll[queue_num], 1, 1))
3666 return 0;
3667
3668 num_entries = complete_cmd_fusion(instance, queue_num, NULL);
3669 atomic_dec(&fusion->busy_mq_poll[queue_num]);
3670
3671 return num_entries;
3672 }
3673
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
Re: [PATCH 3/3] scsi_debug: iouring iopoll support
by kernel test robot
Hi Kashyap,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20201013]
[cannot apply to scsi/for-next mkp-scsi/for-next v5.9 v5.9-rc8 v5.9-rc7 v5.9]
[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/Kashyap-Desai/add-io_uring-with-...
base: f2fb1afc57304f9dd68c20a08270e287470af2eb
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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
# https://github.com/0day-ci/linux/commit/a3173d0d1c2ca8a45007fa994f2641aa7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kashyap-Desai/add-io_uring-with-IOPOLL-support-in-scsi-layer/20201014-202916
git checkout a3173d0d1c2ca8a45007fa994f2641aa7262719c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
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 >>):
drivers/scsi/scsi_debug.c: In function 'schedule_resp':
>> drivers/scsi/scsi_debug.c:5442:3: warning: 'return' with no value, in function returning non-void [-Wreturn-type]
5442 | return;
| ^~~~~~
drivers/scsi/scsi_debug.c:5359:12: note: declared here
5359 | static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
| ^~~~~~~~~~~~~
drivers/scsi/scsi_debug.c: At top level:
>> drivers/scsi/scsi_debug.c:7246:5: warning: no previous prototype for 'sdebug_blk_mq_poll' [-Wmissing-prototypes]
7246 | int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
| ^~~~~~~~~~~~~~~~~~
vim +/return +5442 drivers/scsi/scsi_debug.c
5353
5354 /* Complete the processing of the thread that queued a SCSI command to this
5355 * driver. It either completes the command by calling cmnd_done() or
5356 * schedules a hr timer or work queue then returns 0. Returns
5357 * SCSI_MLQUEUE_HOST_BUSY if temporarily out of resources.
5358 */
5359 static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
5360 int scsi_result,
5361 int (*pfp)(struct scsi_cmnd *,
5362 struct sdebug_dev_info *),
5363 int delta_jiff, int ndelay)
5364 {
5365 bool new_sd_dp;
5366 bool inject = false;
5367 int k, num_in_q, qdepth;
5368 unsigned long iflags;
5369 u64 ns_from_boot = 0;
5370 struct sdebug_queue *sqp;
5371 struct sdebug_queued_cmd *sqcp;
5372 struct scsi_device *sdp;
5373 struct sdebug_defer *sd_dp;
5374
5375 if (unlikely(devip == NULL)) {
5376 if (scsi_result == 0)
5377 scsi_result = DID_NO_CONNECT << 16;
5378 goto respond_in_thread;
5379 }
5380 sdp = cmnd->device;
5381
5382 if (delta_jiff == 0)
5383 goto respond_in_thread;
5384
5385 sqp = get_queue(cmnd);
5386 spin_lock_irqsave(&sqp->qc_lock, iflags);
5387 if (unlikely(atomic_read(&sqp->blocked))) {
5388 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
5389 return SCSI_MLQUEUE_HOST_BUSY;
5390 }
5391 num_in_q = atomic_read(&devip->num_in_q);
5392 qdepth = cmnd->device->queue_depth;
5393 if (unlikely((qdepth > 0) && (num_in_q >= qdepth))) {
5394 if (scsi_result) {
5395 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
5396 goto respond_in_thread;
5397 } else
5398 scsi_result = device_qfull_result;
5399 } else if (unlikely(sdebug_every_nth &&
5400 (SDEBUG_OPT_RARE_TSF & sdebug_opts) &&
5401 (scsi_result == 0))) {
5402 if ((num_in_q == (qdepth - 1)) &&
5403 (atomic_inc_return(&sdebug_a_tsf) >=
5404 abs(sdebug_every_nth))) {
5405 atomic_set(&sdebug_a_tsf, 0);
5406 inject = true;
5407 scsi_result = device_qfull_result;
5408 }
5409 }
5410
5411 k = find_first_zero_bit(sqp->in_use_bm, sdebug_max_queue);
5412 if (unlikely(k >= sdebug_max_queue)) {
5413 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
5414 if (scsi_result)
5415 goto respond_in_thread;
5416 else if (SDEBUG_OPT_ALL_TSF & sdebug_opts)
5417 scsi_result = device_qfull_result;
5418 if (SDEBUG_OPT_Q_NOISE & sdebug_opts)
5419 sdev_printk(KERN_INFO, sdp,
5420 "%s: max_queue=%d exceeded, %s\n",
5421 __func__, sdebug_max_queue,
5422 (scsi_result ? "status: TASK SET FULL" :
5423 "report: host busy"));
5424 if (scsi_result)
5425 goto respond_in_thread;
5426 else
5427 return SCSI_MLQUEUE_HOST_BUSY;
5428 }
5429 set_bit(k, sqp->in_use_bm);
5430 atomic_inc(&devip->num_in_q);
5431 sqcp = &sqp->qc_arr[k];
5432 sqcp->a_cmnd = cmnd;
5433 cmnd->host_scribble = (unsigned char *)sqcp;
5434 sd_dp = sqcp->sd_dp;
5435 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
5436
5437 /* Do not complete IO from default completion path.
5438 * Let it to be on queue.
5439 * Completion should happen from mq_poll interface.
5440 */
5441 if ((sqp - sdebug_q_arr) >= (submit_queues - poll_queues))
> 5442 return;
5443
5444 if (!sd_dp) {
5445 sd_dp = kzalloc(sizeof(*sd_dp), GFP_ATOMIC);
5446 if (!sd_dp) {
5447 atomic_dec(&devip->num_in_q);
5448 clear_bit(k, sqp->in_use_bm);
5449 return SCSI_MLQUEUE_HOST_BUSY;
5450 }
5451 new_sd_dp = true;
5452 } else {
5453 new_sd_dp = false;
5454 }
5455
5456 /* Set the hostwide tag */
5457 if (sdebug_host_max_queue)
5458 sd_dp->hc_idx = get_tag(cmnd);
5459
5460 if (ndelay > 0 && ndelay < INCLUSIVE_TIMING_MAX_NS)
5461 ns_from_boot = ktime_get_boottime_ns();
5462
5463 /* one of the resp_*() response functions is called here */
5464 cmnd->result = pfp ? pfp(cmnd, devip) : 0;
5465 if (cmnd->result & SDEG_RES_IMMED_MASK) {
5466 cmnd->result &= ~SDEG_RES_IMMED_MASK;
5467 delta_jiff = ndelay = 0;
5468 }
5469 if (cmnd->result == 0 && scsi_result != 0)
5470 cmnd->result = scsi_result;
5471 if (cmnd->result == 0 && unlikely(sdebug_opts & SDEBUG_OPT_TRANSPORT_ERR)) {
5472 if (atomic_read(&sdeb_inject_pending)) {
5473 mk_sense_buffer(cmnd, ABORTED_COMMAND, TRANSPORT_PROBLEM, ACK_NAK_TO);
5474 atomic_set(&sdeb_inject_pending, 0);
5475 cmnd->result = check_condition_result;
5476 }
5477 }
5478
5479 if (unlikely(sdebug_verbose && cmnd->result))
5480 sdev_printk(KERN_INFO, sdp, "%s: non-zero result=0x%x\n",
5481 __func__, cmnd->result);
5482
5483 if (delta_jiff > 0 || ndelay > 0) {
5484 ktime_t kt;
5485
5486 if (delta_jiff > 0) {
5487 u64 ns = jiffies_to_nsecs(delta_jiff);
5488
5489 if (sdebug_random && ns < U32_MAX) {
5490 ns = prandom_u32_max((u32)ns);
5491 } else if (sdebug_random) {
5492 ns >>= 12; /* scale to 4 usec precision */
5493 if (ns < U32_MAX) /* over 4 hours max */
5494 ns = prandom_u32_max((u32)ns);
5495 ns <<= 12;
5496 }
5497 kt = ns_to_ktime(ns);
5498 } else { /* ndelay has a 4.2 second max */
5499 kt = sdebug_random ? prandom_u32_max((u32)ndelay) :
5500 (u32)ndelay;
5501 if (ndelay < INCLUSIVE_TIMING_MAX_NS) {
5502 u64 d = ktime_get_boottime_ns() - ns_from_boot;
5503
5504 if (kt <= d) { /* elapsed duration >= kt */
5505 spin_lock_irqsave(&sqp->qc_lock, iflags);
5506 sqcp->a_cmnd = NULL;
5507 atomic_dec(&devip->num_in_q);
5508 clear_bit(k, sqp->in_use_bm);
5509 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
5510 if (new_sd_dp)
5511 kfree(sd_dp);
5512 /* call scsi_done() from this thread */
5513 cmnd->scsi_done(cmnd);
5514 return 0;
5515 }
5516 /* otherwise reduce kt by elapsed time */
5517 kt -= d;
5518 }
5519 }
5520 if (!sd_dp->init_hrt) {
5521 sd_dp->init_hrt = true;
5522 sqcp->sd_dp = sd_dp;
5523 hrtimer_init(&sd_dp->hrt, CLOCK_MONOTONIC,
5524 HRTIMER_MODE_REL_PINNED);
5525 sd_dp->hrt.function = sdebug_q_cmd_hrt_complete;
5526 sd_dp->sqa_idx = sqp - sdebug_q_arr;
5527 sd_dp->qc_idx = k;
5528 }
5529 if (sdebug_statistics)
5530 sd_dp->issuing_cpu = raw_smp_processor_id();
5531 sd_dp->defer_t = SDEB_DEFER_HRT;
5532 /* schedule the invocation of scsi_done() for a later time */
5533 hrtimer_start(&sd_dp->hrt, kt, HRTIMER_MODE_REL_PINNED);
5534 } else { /* jdelay < 0, use work queue */
5535 if (!sd_dp->init_wq) {
5536 sd_dp->init_wq = true;
5537 sqcp->sd_dp = sd_dp;
5538 sd_dp->sqa_idx = sqp - sdebug_q_arr;
5539 sd_dp->qc_idx = k;
5540 INIT_WORK(&sd_dp->ew.work, sdebug_q_cmd_wq_complete);
5541 }
5542 if (sdebug_statistics)
5543 sd_dp->issuing_cpu = raw_smp_processor_id();
5544 sd_dp->defer_t = SDEB_DEFER_WQ;
5545 if (unlikely((sdebug_opts & SDEBUG_OPT_CMD_ABORT) &&
5546 atomic_read(&sdeb_inject_pending)))
5547 sd_dp->aborted = true;
5548 schedule_work(&sd_dp->ew.work);
5549 if (unlikely((sdebug_opts & SDEBUG_OPT_CMD_ABORT) &&
5550 atomic_read(&sdeb_inject_pending))) {
5551 sdev_printk(KERN_INFO, sdp, "abort request tag %d\n", cmnd->request->tag);
5552 blk_abort_request(cmnd->request);
5553 atomic_set(&sdeb_inject_pending, 0);
5554 }
5555 }
5556 if (unlikely((SDEBUG_OPT_Q_NOISE & sdebug_opts) && scsi_result == device_qfull_result))
5557 sdev_printk(KERN_INFO, sdp, "%s: num_in_q=%d +1, %s%s\n", __func__,
5558 num_in_q, (inject ? "<inject> " : ""), "status: TASK SET FULL");
5559 return 0;
5560
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
[sashal-linux-stable:queue-5.4 2/3] fs/btrfs/block-group.c:1189:6: warning: variable 'min_allocable_bytes' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: b19ca15421f87ab0b820032a1891f1e0a13bce70
commit: 07feb40c162ebecbea7d1ea560e553e32e0e8b48 [2/3] btrfs: take overcommit into account in inc_block_group_ro
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout 07feb40c162ebecbea7d1ea560e553e32e0e8b48
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
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 >>):
In file included from arch/xtensa/include/asm/processor.h:15,
from arch/xtensa/include/asm/thread_info.h:20,
from arch/xtensa/include/asm/current.h:14,
from include/linux/sched.h:12,
from fs/btrfs/misc.h:6,
from fs/btrfs/block-group.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
182 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
| ^~~~~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from fs/btrfs/block-group.c:14:
fs/btrfs/sysfs.h: At top level:
fs/btrfs/sysfs.h:16:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
16 | const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
| ^~~~~
fs/btrfs/block-group.c: In function 'inc_block_group_ro':
>> fs/btrfs/block-group.c:1189:6: warning: variable 'min_allocable_bytes' set but not used [-Wunused-but-set-variable]
1189 | u64 min_allocable_bytes;
| ^~~~~~~~~~~~~~~~~~~
vim +/min_allocable_bytes +1189 fs/btrfs/block-group.c
e3e0520b32bc3db Josef Bacik 2019-06-20 1171
26ce2095e03c248 Josef Bacik 2019-06-20 1172 /*
26ce2095e03c248 Josef Bacik 2019-06-20 1173 * Mark block group @cache read-only, so later write won't happen to block
26ce2095e03c248 Josef Bacik 2019-06-20 1174 * group @cache.
26ce2095e03c248 Josef Bacik 2019-06-20 1175 *
26ce2095e03c248 Josef Bacik 2019-06-20 1176 * If @force is not set, this function will only mark the block group readonly
26ce2095e03c248 Josef Bacik 2019-06-20 1177 * if we have enough free space (1M) in other metadata/system block groups.
26ce2095e03c248 Josef Bacik 2019-06-20 1178 * If @force is not set, this function will mark the block group readonly
26ce2095e03c248 Josef Bacik 2019-06-20 1179 * without checking free space.
26ce2095e03c248 Josef Bacik 2019-06-20 1180 *
26ce2095e03c248 Josef Bacik 2019-06-20 1181 * NOTE: This function doesn't care if other block groups can contain all the
26ce2095e03c248 Josef Bacik 2019-06-20 1182 * data in this block group. That check should be done by relocation routine,
26ce2095e03c248 Josef Bacik 2019-06-20 1183 * not this function.
26ce2095e03c248 Josef Bacik 2019-06-20 1184 */
e11c0406ad1bb60 Josef Bacik 2019-06-20 1185 static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)
26ce2095e03c248 Josef Bacik 2019-06-20 1186 {
26ce2095e03c248 Josef Bacik 2019-06-20 1187 struct btrfs_space_info *sinfo = cache->space_info;
26ce2095e03c248 Josef Bacik 2019-06-20 1188 u64 num_bytes;
26ce2095e03c248 Josef Bacik 2019-06-20 @1189 u64 min_allocable_bytes;
26ce2095e03c248 Josef Bacik 2019-06-20 1190 int ret = -ENOSPC;
26ce2095e03c248 Josef Bacik 2019-06-20 1191
26ce2095e03c248 Josef Bacik 2019-06-20 1192 /*
26ce2095e03c248 Josef Bacik 2019-06-20 1193 * We need some metadata space and system metadata space for
26ce2095e03c248 Josef Bacik 2019-06-20 1194 * allocating chunks in some corner cases until we force to set
26ce2095e03c248 Josef Bacik 2019-06-20 1195 * it to be readonly.
26ce2095e03c248 Josef Bacik 2019-06-20 1196 */
26ce2095e03c248 Josef Bacik 2019-06-20 1197 if ((sinfo->flags &
26ce2095e03c248 Josef Bacik 2019-06-20 1198 (BTRFS_BLOCK_GROUP_SYSTEM | BTRFS_BLOCK_GROUP_METADATA)) &&
26ce2095e03c248 Josef Bacik 2019-06-20 1199 !force)
26ce2095e03c248 Josef Bacik 2019-06-20 1200 min_allocable_bytes = SZ_1M;
26ce2095e03c248 Josef Bacik 2019-06-20 1201 else
26ce2095e03c248 Josef Bacik 2019-06-20 1202 min_allocable_bytes = 0;
26ce2095e03c248 Josef Bacik 2019-06-20 1203
26ce2095e03c248 Josef Bacik 2019-06-20 1204 spin_lock(&sinfo->lock);
26ce2095e03c248 Josef Bacik 2019-06-20 1205 spin_lock(&cache->lock);
26ce2095e03c248 Josef Bacik 2019-06-20 1206
26ce2095e03c248 Josef Bacik 2019-06-20 1207 if (cache->ro) {
26ce2095e03c248 Josef Bacik 2019-06-20 1208 cache->ro++;
26ce2095e03c248 Josef Bacik 2019-06-20 1209 ret = 0;
26ce2095e03c248 Josef Bacik 2019-06-20 1210 goto out;
26ce2095e03c248 Josef Bacik 2019-06-20 1211 }
26ce2095e03c248 Josef Bacik 2019-06-20 1212
26ce2095e03c248 Josef Bacik 2019-06-20 1213 num_bytes = cache->key.offset - cache->reserved - cache->pinned -
26ce2095e03c248 Josef Bacik 2019-06-20 1214 cache->bytes_super - btrfs_block_group_used(&cache->item);
26ce2095e03c248 Josef Bacik 2019-06-20 1215
26ce2095e03c248 Josef Bacik 2019-06-20 1216 /*
07feb40c162ebec Josef Bacik 2020-10-14 1217 * Data never overcommits, even in mixed mode, so do just the straight
07feb40c162ebec Josef Bacik 2020-10-14 1218 * check of left over space in how much we have allocated.
07feb40c162ebec Josef Bacik 2020-10-14 1219 */
07feb40c162ebec Josef Bacik 2020-10-14 1220 if (force) {
07feb40c162ebec Josef Bacik 2020-10-14 1221 ret = 0;
07feb40c162ebec Josef Bacik 2020-10-14 1222 } else if (sinfo->flags & BTRFS_BLOCK_GROUP_DATA) {
07feb40c162ebec Josef Bacik 2020-10-14 1223 u64 sinfo_used = btrfs_space_info_used(sinfo, true);
07feb40c162ebec Josef Bacik 2020-10-14 1224
07feb40c162ebec Josef Bacik 2020-10-14 1225 /*
26ce2095e03c248 Josef Bacik 2019-06-20 1226 * Here we make sure if we mark this bg RO, we still have enough
07feb40c162ebec Josef Bacik 2020-10-14 1227 * free space as buffer.
07feb40c162ebec Josef Bacik 2020-10-14 1228 */
07feb40c162ebec Josef Bacik 2020-10-14 1229 if (sinfo_used + num_bytes <= sinfo->total_bytes)
07feb40c162ebec Josef Bacik 2020-10-14 1230 ret = 0;
07feb40c162ebec Josef Bacik 2020-10-14 1231 } else {
07feb40c162ebec Josef Bacik 2020-10-14 1232 /*
07feb40c162ebec Josef Bacik 2020-10-14 1233 * We overcommit metadata, so we need to do the
07feb40c162ebec Josef Bacik 2020-10-14 1234 * btrfs_can_overcommit check here, and we need to pass in
07feb40c162ebec Josef Bacik 2020-10-14 1235 * BTRFS_RESERVE_NO_FLUSH to give ourselves the most amount of
07feb40c162ebec Josef Bacik 2020-10-14 1236 * leeway to allow us to mark this block group as read only.
26ce2095e03c248 Josef Bacik 2019-06-20 1237 */
07feb40c162ebec Josef Bacik 2020-10-14 1238 if (btrfs_can_overcommit(cache->fs_info, sinfo, num_bytes,
07feb40c162ebec Josef Bacik 2020-10-14 1239 BTRFS_RESERVE_NO_FLUSH))
07feb40c162ebec Josef Bacik 2020-10-14 1240 ret = 0;
07feb40c162ebec Josef Bacik 2020-10-14 1241 }
07feb40c162ebec Josef Bacik 2020-10-14 1242
07feb40c162ebec Josef Bacik 2020-10-14 1243 if (!ret) {
26ce2095e03c248 Josef Bacik 2019-06-20 1244 sinfo->bytes_readonly += num_bytes;
26ce2095e03c248 Josef Bacik 2019-06-20 1245 cache->ro++;
26ce2095e03c248 Josef Bacik 2019-06-20 1246 list_add_tail(&cache->ro_list, &sinfo->ro_bgs);
26ce2095e03c248 Josef Bacik 2019-06-20 1247 }
26ce2095e03c248 Josef Bacik 2019-06-20 1248 out:
26ce2095e03c248 Josef Bacik 2019-06-20 1249 spin_unlock(&cache->lock);
26ce2095e03c248 Josef Bacik 2019-06-20 1250 spin_unlock(&sinfo->lock);
26ce2095e03c248 Josef Bacik 2019-06-20 1251 if (ret == -ENOSPC && btrfs_test_opt(cache->fs_info, ENOSPC_DEBUG)) {
26ce2095e03c248 Josef Bacik 2019-06-20 1252 btrfs_info(cache->fs_info,
26ce2095e03c248 Josef Bacik 2019-06-20 1253 "unable to make block group %llu ro",
26ce2095e03c248 Josef Bacik 2019-06-20 1254 cache->key.objectid);
26ce2095e03c248 Josef Bacik 2019-06-20 1255 btrfs_dump_space_info(cache->fs_info, cache->space_info, 0, 0);
26ce2095e03c248 Josef Bacik 2019-06-20 1256 }
26ce2095e03c248 Josef Bacik 2019-06-20 1257 return ret;
26ce2095e03c248 Josef Bacik 2019-06-20 1258 }
26ce2095e03c248 Josef Bacik 2019-06-20 1259
:::::: The code at line 1189 was first introduced by commit
:::::: 26ce2095e03c248759951d81fdff37e2bf32601c btrfs: migrate inc/dec_block_group_ro code
:::::: TO: Josef Bacik <josef(a)toxicpanda.com>
:::::: CC: David Sterba <dsterba(a)suse.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months