[dhowells-fs:netfs-folio-regions 14/28] fs/netfs/write_back.c:103:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio-regions
head: 215a4ee495a95cc73256ed76f91cb78bcabd6b8e
commit: 27ed0ce3a75fcb90e4c016da19682b7fb275ccaf [14/28] netfs: Initiate write request from a dirty region
config: hexagon-randconfig-r041-20210818 (attached as .config)
compiler: clang version 12.0.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/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio-regions
git checkout 27ed0ce3a75fcb90e4c016da19682b7fb275ccaf
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon
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 >>):
>> fs/netfs/write_back.c:103:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!folio_trylock(folio))
^~~~~~~~~~~~~~~~~~~~~
fs/netfs/write_back.c:107:9: note: uninitialized use occurs here
return ret;
^~~
fs/netfs/write_back.c:103:3: note: remove the 'if' if its condition is always true
if (!folio_trylock(folio))
^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/write_back.c:90:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +103 fs/netfs/write_back.c
84
85 static int netfs_lock_folios_iterator(struct xa_state *xas,
86 struct folio *folio,
87 struct netfs_write_request *wreq,
88 struct writeback_control *wbc)
89 {
90 int ret;
91
92 /* At this point we hold neither the i_pages lock nor the
93 * folio lock: the folio may be truncated or invalidated
94 * (changing folio->mapping to NULL), or even swizzled
95 * back from swapper_space to tmpfs file mapping
96 */
97 if (wbc->sync_mode != WB_SYNC_NONE) {
98 xas_pause(xas);
99 rcu_read_unlock();
100 ret = folio_lock_killable(folio);
101 rcu_read_lock();
102 } else {
> 103 if (!folio_trylock(folio))
104 ret = -EBUSY;
105 }
106
107 return ret;
108 }
109
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] Bluetooth: btusb: add a reject table to disable msft
by kernel test robot
Hi Koba,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bluetooth/master]
[also build test WARNING on v5.14-rc6]
[cannot apply to bluetooth-next/master next-20210819]
[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/Koba-Ko/Bluetooth-btusb-add-a-re...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
config: i386-randconfig-a003-20210819 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
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/bbff58c00c9efb048da28df9dbc3c79c0...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Koba-Ko/Bluetooth-btusb-add-a-reject-table-to-disable-msft/20210819-220108
git checkout bbff58c00c9efb048da28df9dbc3c79c0c40763b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
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 >>):
clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument]
In file included from drivers/bluetooth/btusb.c:9:
In file included from include/linux/dmi.h:6:
In file included from include/linux/kobject.h:20:
In file included from include/linux/sysfs.h:16:
In file included from include/linux/kernfs.h:12:
In file included from include/linux/mutex.h:17:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:110:
In file included from include/linux/preempt.h:78:
In file included from arch/x86/include/asm/preempt.h:7:
In file included from include/linux/thread_info.h:59:
arch/x86/include/asm/thread_info.h:172:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
oldframe = __builtin_frame_address(1);
^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/thread_info.h:174:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
frame = __builtin_frame_address(2);
^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/bluetooth/btusb.c:2917:9: warning: assigning to 'struct usb_device_id *' from 'const struct usb_device_id *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
match = usb_match_id(data->intf, msft_rej_table);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
vim +2917 drivers/bluetooth/btusb.c
2829
2830 static int btusb_setup_intel_new(struct hci_dev *hdev)
2831 {
2832 struct btusb_data *data = hci_get_drvdata(hdev);
2833 struct intel_version ver;
2834 struct intel_boot_params params;
2835 u32 boot_param;
2836 char ddcname[64];
2837 int err;
2838 struct intel_debug_features features;
2839 struct usb_device_id *match;
2840
2841 BT_DBG("%s", hdev->name);
2842
2843 /* Set the default boot parameter to 0x0 and it is updated to
2844 * SKU specific boot parameter after reading Intel_Write_Boot_Params
2845 * command while downloading the firmware.
2846 */
2847 boot_param = 0x00000000;
2848
2849 /* Read the Intel version information to determine if the device
2850 * is in bootloader mode or if it already has operational firmware
2851 * loaded.
2852 */
2853 err = btintel_read_version(hdev, &ver);
2854 if (err) {
2855 bt_dev_err(hdev, "Intel Read version failed (%d)", err);
2856 btintel_reset_to_bootloader(hdev);
2857 return err;
2858 }
2859
2860 err = btintel_version_info(hdev, &ver);
2861 if (err)
2862 return err;
2863
2864 err = btusb_intel_download_firmware(hdev, &ver, ¶ms, &boot_param);
2865 if (err)
2866 return err;
2867
2868 /* controller is already having an operational firmware */
2869 if (ver.fw_variant == 0x23)
2870 goto finish;
2871
2872 err = btusb_intel_boot(hdev, boot_param);
2873 if (err)
2874 return err;
2875
2876 clear_bit(BTUSB_BOOTLOADER, &data->flags);
2877
2878 err = btusb_setup_intel_new_get_fw_name(&ver, ¶ms, ddcname,
2879 sizeof(ddcname), "ddc");
2880
2881 if (err < 0) {
2882 bt_dev_err(hdev, "Unsupported Intel firmware naming");
2883 } else {
2884 /* Once the device is running in operational mode, it needs to
2885 * apply the device configuration (DDC) parameters.
2886 *
2887 * The device can work without DDC parameters, so even if it
2888 * fails to load the file, no need to fail the setup.
2889 */
2890 btintel_load_ddc_config(hdev, ddcname);
2891 }
2892
2893 /* Read the Intel supported features and if new exception formats
2894 * supported, need to load the additional DDC config to enable.
2895 */
2896 btintel_read_debug_features(hdev, &features);
2897
2898 /* Set DDC mask for available debug features */
2899 btintel_set_debug_features(hdev, &features);
2900
2901 /* Read the Intel version information after loading the FW */
2902 err = btintel_read_version(hdev, &ver);
2903 if (err)
2904 return err;
2905
2906 btintel_version_info(hdev, &ver);
2907
2908 finish:
2909 /* All Intel controllers that support the Microsoft vendor
2910 * extension are using 0xFC1E for VsMsftOpCode.
2911 */
2912 switch (ver.hw_variant) {
2913 case 0x11: /* JfP */
2914 case 0x12: /* ThP */
2915 case 0x13: /* HrP */
2916 case 0x14: /* CcP */
> 2917 match = usb_match_id(data->intf, msft_rej_table);
2918 if (!match)
2919 hci_set_msft_opcode(hdev, 0xFC1E);
2920 break;
2921 }
2922
2923 /* Set the event mask for Intel specific vendor events. This enables
2924 * a few extra events that are useful during general operation. It
2925 * does not enable any debugging related events.
2926 *
2927 * The device will function correctly without these events enabled
2928 * and thus no need to fail the setup.
2929 */
2930 btintel_set_event_mask(hdev, false);
2931
2932 return 0;
2933 }
2934
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[dhowells-fs:netfs-folio-regions 22/28] fs/netfs/write_back.c:763:17: warning: enumeration value 'NETFS_REGION_IS_PENDING' not handled in switch
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio-regions
head: 215a4ee495a95cc73256ed76f91cb78bcabd6b8e
commit: 1e4f2a70cbedd75d80440425727faa78e2dccb93 [22/28] netfs: Cut out region to be written from dirty regions
config: alpha-randconfig-r011-20210819 (attached as .config)
compiler: alpha-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
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio-regions
git checkout 1e4f2a70cbedd75d80440425727faa78e2dccb93
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=alpha
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 >>):
fs/netfs/write_back.c: In function 'netfs_flush_dirty':
>> fs/netfs/write_back.c:763:17: warning: enumeration value 'NETFS_REGION_IS_PENDING' not handled in switch [-Wswitch]
763 | switch (READ_ONCE(r->state)) {
| ^~~~~~
>> fs/netfs/write_back.c:763:17: warning: enumeration value 'NETFS_REGION_IS_RESERVED' not handled in switch [-Wswitch]
>> fs/netfs/write_back.c:763:17: warning: enumeration value 'NETFS_REGION_IS_COMPLETE' not handled in switch [-Wswitch]
vim +/NETFS_REGION_IS_PENDING +763 fs/netfs/write_back.c
623
624 /*
625 * Flush some of the dirty queue, transforming a part of a sequence of dirty
626 * regions into a block we can flush.
627 *
628 * A number of things constrain us:
629 * - The region we write out should not be undergoing modification
630 * - We may need to expand or split the region for a number of reasons:
631 * - Filesystem storage block/object size
632 * - Filesystem RPC size (wsize)
633 * - Cache block size
634 * - Cache DIO block size
635 * - Crypto/compression block size
636 */
637 static int netfs_flush_dirty(struct address_space *mapping,
638 struct writeback_control *wbc,
639 struct netfs_range *requested,
640 loff_t *next)
641 {
642 struct netfs_i_context *ctx = netfs_i_context(mapping->host);
643 struct netfs_dirty_region *spares[2] = {};
644 struct netfs_dirty_region *head = NULL, *tail = NULL, *r, *q;
645 struct netfs_range block;
646 unsigned long long dirty_start, dirty_to, active_from, limit;
647 unsigned int wsize = ctx->wsize;
648 unsigned int min_bsize = 1U << ctx->min_bshift;
649 int ret;
650
651 kenter("%llx-%llx", requested->start, requested->end);
652
653 BUG_ON(!wsize);
654
655 /* For the moment, place certain restrictions when content crypto is in
656 * use so that we don't write a partial block and corrupt part of the
657 * file into unreadability.
658 */
659 if (ctx->crypto_bshift) {
660 /* If object storage is in use, we don't want a crypto block to
661 * be split across multiple objects.
662 */
663 if (ctx->obj_bshift &&
664 ctx->crypto_bshift > ctx->obj_bshift) {
665 pr_err_ratelimited("Crypto blocksize (2^%u) > objsize (2^%u)\n",
666 ctx->crypto_bshift, ctx->obj_bshift);
667 return -EIO;
668 }
669
670 /* We must be able to write a crypto block in its entirety in a
671 * single RPC call if we're going to do the write atomically.
672 */
673 if ((1U << ctx->crypto_bshift) > wsize) {
674 pr_err_ratelimited("Crypto blocksize (2^%u) > wsize (%u)\n",
675 ctx->crypto_bshift, wsize);
676 return -EIO;
677 }
678 }
679
680 /* Round the requested region out to the minimum block size (eg. for
681 * crypto purposes).
682 */
683 requested->start = round_down(requested->start, min_bsize);
684 requested->end = round_up (requested->end, min_bsize);
685
686 retry:
687 ret = 0;
688
689 spin_lock(&ctx->lock);
690
691 /* Find the first dirty region that overlaps the requested flush region */
692 list_for_each_entry(r, &ctx->dirty_regions, dirty_link) {
693 kdebug("query D=%x", r->debug_id);
694 if (r->dirty.end <= requested->start ||
695 r->dirty.end == r->dirty.start)
696 continue;
697 if (READ_ONCE(r->state) == NETFS_REGION_IS_FLUSHING)
698 continue;
699 if (r->dirty.start >= requested->end)
700 goto out;
701 head = r;
702 break;
703 }
704
705 if (!head || head->dirty.start >= requested->end)
706 goto out;
707
708 /* Determine where we're going to start and the limits on where we
709 * might end.
710 */
711 dirty_start = round_down(head->dirty.start, min_bsize);
712 kdebug("dirty D=%x start %llx", head->debug_id, dirty_start);
713
714 if (ctx->obj_bshift) {
715 /* Handle object storage - we limit the write to one object,
716 * but we round down the start if there's more dirty data that
717 * way.
718 */
719 unsigned long long obj_start;
720 unsigned long long obj_size = 1ULL << ctx->obj_bshift;
721 unsigned long long obj_end;
722
723 obj_start = max(requested->start, dirty_start);
724 obj_start = round_down(obj_start, obj_size);
725 obj_end = obj_start + obj_size;
726 kdebug("object %llx-%llx", obj_start, obj_end);
727
728 block.start = max(dirty_start, obj_start);
729 limit = min(requested->end, obj_end);
730 kdebug("limit %llx", limit);
731 if (limit - block.start > wsize) {
732 kdebug("size %llx", limit - block.start);
733 block.start = max(block.start, requested->start);
734 limit = min(requested->end,
735 block.start + round_down(wsize, min_bsize));
736 }
737 kdebug("object %llx-%llx", block.start, limit);
738 } else if (min_bsize > 1) {
739 /* There's a block size (cache DIO, crypto). */
740 block.start = max(dirty_start, requested->start);
741 if (wsize > min_bsize) {
742 /* A single write can encompass several blocks. */
743 limit = block.start + round_down(wsize, min_bsize);
744 limit = min(limit, requested->end);
745 } else {
746 /* The block will need several writes to send it. */
747 limit = block.start + min_bsize;
748 }
749 kdebug("block %llx-%llx", block.start, limit);
750 } else {
751 /* No blocking factors and no object division. */
752 block.start = max(dirty_start, requested->start);
753 limit = min(block.start + wsize, requested->end);
754 kdebug("plain %llx-%llx", block.start, limit);
755 }
756
757 /* Determine the subset of dirty regions that are going to contribute. */
758 r = head;
759 list_for_each_entry_from(r, &ctx->dirty_regions, dirty_link) {
760 kdebug("- maybe D=%x", r->debug_id);
761 if (r->dirty.start >= limit)
762 break;
> 763 switch (READ_ONCE(r->state)) {
764 case NETFS_REGION_IS_DIRTY:
765 tail = r;
766 continue;
767 case NETFS_REGION_IS_FLUSHING:
768 limit = round_down(r->dirty.start, min_bsize);
769 goto determined_tail;
770 case NETFS_REGION_IS_ACTIVE:
771 /* We can break off part of a region undergoing active
772 * modification, but assume, for now, that we don't
773 * want to include anything that will change under us
774 * or that's only partially uptodate - especially if
775 * we're going to be encrypting or compressing from it.
776 */
777 dirty_to = READ_ONCE(r->dirty.end);
778 active_from = round_down(dirty_to, min_bsize);
779 kdebug("active D=%x from %llx", r->debug_id, active_from);
780 if (active_from > limit) {
781 kdebug(" - >limit");
782 tail = r;
783 goto determined_tail;
784 }
785
786 limit = active_from;
787 if (r->dirty.start < limit) {
788 kdebug(" - reduce limit");
789 tail = r;
790 goto determined_tail;
791 }
792
793 if (limit == block.start || r == head)
794 goto wait_for_active_region;
795
796 if (limit == r->dirty.start) {
797 kdebug("- active contig");
798 goto determined_tail;
799 }
800
801 /* We may need to rewind the subset we're collecting. */
802 q = r;
803 list_for_each_entry_continue_reverse(q, &ctx->dirty_regions,
804 dirty_link) {
805 kdebug(" - rewind D=%x", q->debug_id);
806 tail = q;
807 if (q->dirty.start < limit)
808 goto determined_tail;
809 if (q == head) {
810 kdebug("over rewound");
811 ret = -EAGAIN;
812 goto out;
813 }
814 }
815 goto wait_for_active_region;
816 }
817 }
818
819 determined_tail:
820 if (!tail) {
821 kdebug("netfs: no tail\n");
822 ret = -EAGAIN;
823 goto out;
824 }
825 dirty_to = round_up(tail->dirty.end, min_bsize);
826 kdebug("dto %llx", dirty_to);
827 block.end = min(dirty_to, limit);
828 kdebug("block %llx-%llx", block.start, block.end);
829
830 /* If the leading and/or trailing edges of the selected regions overlap
831 * the ends of the block, we will need to split those blocks.
832 */
833 if ((dirty_start < block.start && !spares[0]) ||
834 (tail->dirty.end > block.end && !spares[1])) {
835 spin_unlock(&ctx->lock);
836 kdebug("need spares");
837 goto need_spares;
838 }
839
840 if (dirty_start < block.start) {
841 kdebug("eject front");
842 netfs_split_off_front(ctx, head, &spares[0], block.start);
843 }
844
845 if (tail->dirty.end > block.end) {
846 kdebug("eject back");
847 r = netfs_split_off_front(ctx, tail, &spares[1], block.end);
848 if (head == tail)
849 head = r;
850 tail = r;
851 }
852
853 /* Flip all the regions to flushing */
854 r = head;
855 kdebug("mark from D=%x", r->debug_id);
856 list_for_each_entry_from(r, &ctx->dirty_regions, dirty_link) {
857 kdebug("- flush D=%x", r->debug_id);
858 set_bit(NETFS_REGION_FLUSH_Q, &r->flags);
859 smp_store_release(&r->state, NETFS_REGION_IS_FLUSHING);
860 trace_netfs_dirty(ctx, r, NULL, netfs_dirty_trace_flushing);
861 wake_up_var(&r->state);
862 list_move_tail(&r->flush_link, &ctx->flush_queue);
863 if (r == tail)
864 break;
865 }
866
867 requested->start = block.end;
868 out:
869 spin_unlock(&ctx->lock);
870
871 out_unlocked:
872 netfs_free_dirty_region(ctx, spares[0]);
873 netfs_free_dirty_region(ctx, spares[1]);
874 kleave(" = %d", ret);
875 return ret;
876
877 wait_for_active_region:
878 /* We have to wait for an active region to progress */
879 kdebug("- wait for active %x", r->debug_id);
880 set_bit(NETFS_REGION_FLUSH_Q, &r->flags);
881
882 if (wbc->sync_mode == WB_SYNC_NONE) {
883 ret = -EBUSY;
884 goto out;
885 }
886
887 netfs_get_dirty_region(ctx, r, netfs_region_trace_get_wait_active);
888 spin_unlock(&ctx->lock);
889
890 wait_var_event(&r->state, (READ_ONCE(r->state) != NETFS_REGION_IS_ACTIVE ||
891 READ_ONCE(r->dirty.end) != dirty_to));
892 netfs_put_dirty_region(ctx, r, netfs_region_trace_put_wait_active);
893
894 need_spares:
895 ret = -ENOMEM;
896 spares[0] = netfs_alloc_dirty_region();
897 if (!spares[0])
898 goto out_unlocked;
899 spares[1] = netfs_alloc_dirty_region();
900 if (!spares[1])
901 goto out_unlocked;
902 goto retry;
903 }
904
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[dhowells-fs:netfs-folio-regions 16/28] fs/netfs/objects.c:125:24: error: implicit declaration of function 'netfs_is_cache_enabled'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio-regions
head: 215a4ee495a95cc73256ed76f91cb78bcabd6b8e
commit: f3e6e00066254822783e68e4c3bf9f8904f6ab6a [16/28] netfs: Send write request to multiple destinations
config: arc-randconfig-r043-20210818 (attached as .config)
compiler: arceb-elf-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
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio-regions
git checkout f3e6e00066254822783e68e4c3bf9f8904f6ab6a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc
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 >>):
fs/netfs/objects.c: In function 'netfs_alloc_write_request':
>> fs/netfs/objects.c:125:24: error: implicit declaration of function 'netfs_is_cache_enabled' [-Werror=implicit-function-declaration]
125 | if (!is_dio && netfs_is_cache_enabled(ctx)) {
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/netfs_is_cache_enabled +125 fs/netfs/objects.c
114
115 struct netfs_write_request *netfs_alloc_write_request(struct address_space *mapping,
116 bool is_dio)
117 {
118 static atomic_t debug_ids;
119 struct inode *inode = mapping->host;
120 struct netfs_i_context *ctx = netfs_i_context(inode);
121 struct netfs_write_request *wreq;
122 unsigned int n_streams = ctx->n_wstreams, i;
123 bool cached = false;
124
> 125 if (!is_dio && netfs_is_cache_enabled(ctx)) {
126 n_streams++;
127 cached = true;
128 }
129
130 wreq = kzalloc(struct_size(wreq, streams, n_streams), GFP_KERNEL);
131 if (wreq) {
132 wreq->mapping = mapping;
133 wreq->inode = inode;
134 wreq->netfs_ops = ctx->ops;
135 wreq->max_streams = n_streams;
136 wreq->debug_id = atomic_inc_return(&debug_ids);
137 if (cached)
138 __set_bit(NETFS_WREQ_WRITE_TO_CACHE, &wreq->flags);
139 xa_init(&wreq->buffer);
140 INIT_WORK(&wreq->work, netfs_writeback_worker);
141 for (i = 0; i < n_streams; i++)
142 INIT_LIST_HEAD(&wreq->streams[i].subrequests);
143 refcount_set(&wreq->usage, 1);
144 atomic_set(&wreq->outstanding, 1);
145 ctx->ops->init_wreq(wreq);
146 netfs_stat(&netfs_n_wh_wreq);
147 trace_netfs_ref_wreq(wreq->debug_id, 1, netfs_wreq_trace_new);
148 }
149
150 return wreq;
151 }
152
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] Bluetooth: btusb: add a reject table to disable msft
by kernel test robot
Hi Koba,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bluetooth/master]
[also build test WARNING on v5.14-rc6]
[cannot apply to bluetooth-next/master next-20210819]
[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/Koba-Ko/Bluetooth-btusb-add-a-re...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
config: mips-randconfig-s032-20210818 (attached as .config)
compiler: mips64-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.3-348-gf0e6938b-dirty
# https://github.com/0day-ci/linux/commit/bbff58c00c9efb048da28df9dbc3c79c0...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Koba-Ko/Bluetooth-btusb-add-a-reject-table-to-disable-msft/20210819-220108
git checkout bbff58c00c9efb048da28df9dbc3c79c0c40763b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips
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 >>)
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
drivers/bluetooth/btusb.c:1852:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1856:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1860:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1864:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1868:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1874:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1912:21: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2421:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2430:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2431:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2432:25: sparse: sparse: cast to restricted __le16
>> drivers/bluetooth/btusb.c:2917:23: sparse: sparse: incorrect type in assignment (different modifiers) @@ expected struct usb_device_id *match @@ got struct usb_device_id const * @@
drivers/bluetooth/btusb.c:2917:23: sparse: expected struct usb_device_id *match
drivers/bluetooth/btusb.c:2917:23: sparse: got struct usb_device_id const *
drivers/bluetooth/btusb.c:4131:28: sparse: sparse: cast to restricted __le32
drivers/bluetooth/btusb.c:4162:18: sparse: sparse: restricted __le16 degrades to integer
vim +2917 drivers/bluetooth/btusb.c
2829
2830 static int btusb_setup_intel_new(struct hci_dev *hdev)
2831 {
2832 struct btusb_data *data = hci_get_drvdata(hdev);
2833 struct intel_version ver;
2834 struct intel_boot_params params;
2835 u32 boot_param;
2836 char ddcname[64];
2837 int err;
2838 struct intel_debug_features features;
2839 struct usb_device_id *match;
2840
2841 BT_DBG("%s", hdev->name);
2842
2843 /* Set the default boot parameter to 0x0 and it is updated to
2844 * SKU specific boot parameter after reading Intel_Write_Boot_Params
2845 * command while downloading the firmware.
2846 */
2847 boot_param = 0x00000000;
2848
2849 /* Read the Intel version information to determine if the device
2850 * is in bootloader mode or if it already has operational firmware
2851 * loaded.
2852 */
2853 err = btintel_read_version(hdev, &ver);
2854 if (err) {
2855 bt_dev_err(hdev, "Intel Read version failed (%d)", err);
2856 btintel_reset_to_bootloader(hdev);
2857 return err;
2858 }
2859
2860 err = btintel_version_info(hdev, &ver);
2861 if (err)
2862 return err;
2863
2864 err = btusb_intel_download_firmware(hdev, &ver, ¶ms, &boot_param);
2865 if (err)
2866 return err;
2867
2868 /* controller is already having an operational firmware */
2869 if (ver.fw_variant == 0x23)
2870 goto finish;
2871
2872 err = btusb_intel_boot(hdev, boot_param);
2873 if (err)
2874 return err;
2875
2876 clear_bit(BTUSB_BOOTLOADER, &data->flags);
2877
2878 err = btusb_setup_intel_new_get_fw_name(&ver, ¶ms, ddcname,
2879 sizeof(ddcname), "ddc");
2880
2881 if (err < 0) {
2882 bt_dev_err(hdev, "Unsupported Intel firmware naming");
2883 } else {
2884 /* Once the device is running in operational mode, it needs to
2885 * apply the device configuration (DDC) parameters.
2886 *
2887 * The device can work without DDC parameters, so even if it
2888 * fails to load the file, no need to fail the setup.
2889 */
2890 btintel_load_ddc_config(hdev, ddcname);
2891 }
2892
2893 /* Read the Intel supported features and if new exception formats
2894 * supported, need to load the additional DDC config to enable.
2895 */
2896 btintel_read_debug_features(hdev, &features);
2897
2898 /* Set DDC mask for available debug features */
2899 btintel_set_debug_features(hdev, &features);
2900
2901 /* Read the Intel version information after loading the FW */
2902 err = btintel_read_version(hdev, &ver);
2903 if (err)
2904 return err;
2905
2906 btintel_version_info(hdev, &ver);
2907
2908 finish:
2909 /* All Intel controllers that support the Microsoft vendor
2910 * extension are using 0xFC1E for VsMsftOpCode.
2911 */
2912 switch (ver.hw_variant) {
2913 case 0x11: /* JfP */
2914 case 0x12: /* ThP */
2915 case 0x13: /* HrP */
2916 case 0x14: /* CcP */
> 2917 match = usb_match_id(data->intf, msft_rej_table);
2918 if (!match)
2919 hci_set_msft_opcode(hdev, 0xFC1E);
2920 break;
2921 }
2922
2923 /* Set the event mask for Intel specific vendor events. This enables
2924 * a few extra events that are useful during general operation. It
2925 * does not enable any debugging related events.
2926 *
2927 * The device will function correctly without these events enabled
2928 * and thus no need to fail the setup.
2929 */
2930 btintel_set_event_mask(hdev, false);
2931
2932 return 0;
2933 }
2934
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[linux-platform-drivers-x86:review-hans 60/78] drivers/mfd/intel_pmc_bxt.c:181: undefined reference to `intel_scu_ipc_dev_simple_command'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8... review-hans
head: b1341d3e93b26a85bb765f7eddd717d409bc1ef8
commit: 05c8d91f374b5dceeb322221eca48077005b1686 [60/78] platform/x86: intel_scu: Move to intel sub-directory
config: i386-randconfig-m021-20210818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
git remote add linux-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
git fetch --no-tags linux-platform-drivers-x86 review-hans
git checkout 05c8d91f374b5dceeb322221eca48077005b1686
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 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 >>):
ld: drivers/mfd/intel_pmc_bxt.o: in function `simplecmd_store':
>> drivers/mfd/intel_pmc_bxt.c:181: undefined reference to `intel_scu_ipc_dev_simple_command'
ld: drivers/mfd/intel_pmc_bxt.o: in function `northpeak_store':
drivers/mfd/intel_pmc_bxt.c:221: undefined reference to `intel_scu_ipc_dev_simple_command'
ld: drivers/mfd/intel_pmc_bxt.o: in function `intel_pmc_probe':
>> drivers/mfd/intel_pmc_bxt.c:442: undefined reference to `__devm_intel_scu_ipc_register'
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for INTEL_SCU_IPC
Depends on X86 && X86_PLATFORM_DEVICES && X86_PLATFORM_DRIVERS_INTEL
Selected by
- MFD_INTEL_PMC_BXT && HAS_IOMEM && X86 && X86_PLATFORM_DEVICES && ACPI
vim +181 drivers/mfd/intel_pmc_bxt.c
25f1ca31e23059 Mika Westerberg 2020-04-16 152
25f1ca31e23059 Mika Westerberg 2020-04-16 153 /**
25f1ca31e23059 Mika Westerberg 2020-04-16 154 * simplecmd_store() - Send a simple IPC command
25f1ca31e23059 Mika Westerberg 2020-04-16 155 * @dev: Device under the attribute is
25f1ca31e23059 Mika Westerberg 2020-04-16 156 * @attr: Attribute in question
25f1ca31e23059 Mika Westerberg 2020-04-16 157 * @buf: Buffer holding data to be stored to the attribute
25f1ca31e23059 Mika Westerberg 2020-04-16 158 * @count: Number of bytes in @buf
25f1ca31e23059 Mika Westerberg 2020-04-16 159 *
25f1ca31e23059 Mika Westerberg 2020-04-16 160 * Expects a string with two integers separated with space. These two
25f1ca31e23059 Mika Westerberg 2020-04-16 161 * values hold command and subcommand that is send to PMC.
25f1ca31e23059 Mika Westerberg 2020-04-16 162 *
25f1ca31e23059 Mika Westerberg 2020-04-16 163 * Return: Number number of bytes written (@count) or negative errno in
25f1ca31e23059 Mika Westerberg 2020-04-16 164 * case of error.
25f1ca31e23059 Mika Westerberg 2020-04-16 165 */
25f1ca31e23059 Mika Westerberg 2020-04-16 166 static ssize_t simplecmd_store(struct device *dev, struct device_attribute *attr,
25f1ca31e23059 Mika Westerberg 2020-04-16 167 const char *buf, size_t count)
25f1ca31e23059 Mika Westerberg 2020-04-16 168 {
25f1ca31e23059 Mika Westerberg 2020-04-16 169 struct intel_pmc_dev *pmc = dev_get_drvdata(dev);
25f1ca31e23059 Mika Westerberg 2020-04-16 170 struct intel_scu_ipc_dev *scu = pmc->scu;
25f1ca31e23059 Mika Westerberg 2020-04-16 171 int subcmd;
25f1ca31e23059 Mika Westerberg 2020-04-16 172 int cmd;
25f1ca31e23059 Mika Westerberg 2020-04-16 173 int ret;
25f1ca31e23059 Mika Westerberg 2020-04-16 174
25f1ca31e23059 Mika Westerberg 2020-04-16 175 ret = sscanf(buf, "%d %d", &cmd, &subcmd);
25f1ca31e23059 Mika Westerberg 2020-04-16 176 if (ret != 2) {
25f1ca31e23059 Mika Westerberg 2020-04-16 177 dev_err(dev, "Invalid values, expected: cmd subcmd\n");
25f1ca31e23059 Mika Westerberg 2020-04-16 178 return -EINVAL;
25f1ca31e23059 Mika Westerberg 2020-04-16 179 }
25f1ca31e23059 Mika Westerberg 2020-04-16 180
25f1ca31e23059 Mika Westerberg 2020-04-16 @181 ret = intel_scu_ipc_dev_simple_command(scu, cmd, subcmd);
25f1ca31e23059 Mika Westerberg 2020-04-16 182 if (ret)
25f1ca31e23059 Mika Westerberg 2020-04-16 183 return ret;
25f1ca31e23059 Mika Westerberg 2020-04-16 184
25f1ca31e23059 Mika Westerberg 2020-04-16 185 return count;
25f1ca31e23059 Mika Westerberg 2020-04-16 186 }
25f1ca31e23059 Mika Westerberg 2020-04-16 187 static DEVICE_ATTR_WO(simplecmd);
25f1ca31e23059 Mika Westerberg 2020-04-16 188
:::::: The code at line 181 was first introduced by commit
:::::: 25f1ca31e230598eaf3c38d387a355a64bd772a7 platform/x86: intel_pmc_ipc: Convert to MFD
:::::: TO: Mika Westerberg <mika.westerberg(a)linux.intel.com>
:::::: CC: Lee Jones <lee.jones(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] Bluetooth: btusb: add a reject table to disable msft
by kernel test robot
Hi Koba,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bluetooth/master]
[also build test WARNING on v5.14-rc6]
[cannot apply to bluetooth-next/master next-20210819]
[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/Koba-Ko/Bluetooth-btusb-add-a-re...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
config: m68k-buildonly-randconfig-r002-20210818 (attached as .config)
compiler: m68k-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
# https://github.com/0day-ci/linux/commit/bbff58c00c9efb048da28df9dbc3c79c0...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Koba-Ko/Bluetooth-btusb-add-a-reject-table-to-disable-msft/20210819-220108
git checkout bbff58c00c9efb048da28df9dbc3c79c0c40763b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
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/bluetooth/btusb.c: In function 'btusb_setup_intel_new':
>> drivers/bluetooth/btusb.c:2917:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
2917 | match = usb_match_id(data->intf, msft_rej_table);
| ^
vim +/const +2917 drivers/bluetooth/btusb.c
2829
2830 static int btusb_setup_intel_new(struct hci_dev *hdev)
2831 {
2832 struct btusb_data *data = hci_get_drvdata(hdev);
2833 struct intel_version ver;
2834 struct intel_boot_params params;
2835 u32 boot_param;
2836 char ddcname[64];
2837 int err;
2838 struct intel_debug_features features;
2839 struct usb_device_id *match;
2840
2841 BT_DBG("%s", hdev->name);
2842
2843 /* Set the default boot parameter to 0x0 and it is updated to
2844 * SKU specific boot parameter after reading Intel_Write_Boot_Params
2845 * command while downloading the firmware.
2846 */
2847 boot_param = 0x00000000;
2848
2849 /* Read the Intel version information to determine if the device
2850 * is in bootloader mode or if it already has operational firmware
2851 * loaded.
2852 */
2853 err = btintel_read_version(hdev, &ver);
2854 if (err) {
2855 bt_dev_err(hdev, "Intel Read version failed (%d)", err);
2856 btintel_reset_to_bootloader(hdev);
2857 return err;
2858 }
2859
2860 err = btintel_version_info(hdev, &ver);
2861 if (err)
2862 return err;
2863
2864 err = btusb_intel_download_firmware(hdev, &ver, ¶ms, &boot_param);
2865 if (err)
2866 return err;
2867
2868 /* controller is already having an operational firmware */
2869 if (ver.fw_variant == 0x23)
2870 goto finish;
2871
2872 err = btusb_intel_boot(hdev, boot_param);
2873 if (err)
2874 return err;
2875
2876 clear_bit(BTUSB_BOOTLOADER, &data->flags);
2877
2878 err = btusb_setup_intel_new_get_fw_name(&ver, ¶ms, ddcname,
2879 sizeof(ddcname), "ddc");
2880
2881 if (err < 0) {
2882 bt_dev_err(hdev, "Unsupported Intel firmware naming");
2883 } else {
2884 /* Once the device is running in operational mode, it needs to
2885 * apply the device configuration (DDC) parameters.
2886 *
2887 * The device can work without DDC parameters, so even if it
2888 * fails to load the file, no need to fail the setup.
2889 */
2890 btintel_load_ddc_config(hdev, ddcname);
2891 }
2892
2893 /* Read the Intel supported features and if new exception formats
2894 * supported, need to load the additional DDC config to enable.
2895 */
2896 btintel_read_debug_features(hdev, &features);
2897
2898 /* Set DDC mask for available debug features */
2899 btintel_set_debug_features(hdev, &features);
2900
2901 /* Read the Intel version information after loading the FW */
2902 err = btintel_read_version(hdev, &ver);
2903 if (err)
2904 return err;
2905
2906 btintel_version_info(hdev, &ver);
2907
2908 finish:
2909 /* All Intel controllers that support the Microsoft vendor
2910 * extension are using 0xFC1E for VsMsftOpCode.
2911 */
2912 switch (ver.hw_variant) {
2913 case 0x11: /* JfP */
2914 case 0x12: /* ThP */
2915 case 0x13: /* HrP */
2916 case 0x14: /* CcP */
> 2917 match = usb_match_id(data->intf, msft_rej_table);
2918 if (!match)
2919 hci_set_msft_opcode(hdev, 0xFC1E);
2920 break;
2921 }
2922
2923 /* Set the event mask for Intel specific vendor events. This enables
2924 * a few extra events that are useful during general operation. It
2925 * does not enable any debugging related events.
2926 *
2927 * The device will function correctly without these events enabled
2928 * and thus no need to fail the setup.
2929 */
2930 btintel_set_event_mask(hdev, false);
2931
2932 return 0;
2933 }
2934
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[dhowells-fs:netfs-folio-regions 13/28] fs/netfs/write_helper.c:758:25: error: implicit declaration of function 'flush_dcache_folio'; did you mean 'flush_dcache_page'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio-regions
head: 215a4ee495a95cc73256ed76f91cb78bcabd6b8e
commit: ec49a6ac065699ec5e4f782529b05681d970dde9 [13/28] netfs: Keep lists of pending, active, dirty and flushed regions
config: sh-allmodconfig (attached as .config)
compiler: sh4-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
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/com...
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio-regions
git checkout ec49a6ac065699ec5e4f782529b05681d970dde9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sh
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/kernel.h:16,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/netfs/write_helper.c:9:
fs/netfs/write_helper.c: In function 'copy_folio_from_iter_atomic':
include/linux/minmax.h:20:35: warning: comparison of distinct pointer types lacks a cast
20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/linux/minmax.h:26:18: note: in expansion of macro '__typecheck'
26 | (__typecheck(x, y) && __no_side_effects(x, y))
| ^~~~~~~~~~~
include/linux/minmax.h:36:31: note: in expansion of macro '__safe_cmp'
36 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:45:25: note: in expansion of macro '__careful_cmp'
45 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
fs/netfs/write_helper.c:25:40: note: in expansion of macro 'min'
25 | unsigned int psize = min(PAGE_SIZE - offset, size);
| ^~~
fs/netfs/write_helper.c: In function 'netfs_perform_write':
>> fs/netfs/write_helper.c:758:25: error: implicit declaration of function 'flush_dcache_folio'; did you mean 'flush_dcache_page'? [-Werror=implicit-function-declaration]
758 | flush_dcache_folio(folio);
| ^~~~~~~~~~~~~~~~~~
| flush_dcache_page
>> fs/netfs/write_helper.c:784:58: error: 'struct netfs_i_context' has no member named 'cache'
784 | fscache_update_cookie(ctx->cache, NULL);
| ^~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +758 fs/netfs/write_helper.c
680
681 /*
682 * Write data into a prereserved region of the pagecache attached to a netfs
683 * inode.
684 */
685 static ssize_t netfs_perform_write(struct netfs_dirty_region *region,
686 struct kiocb *iocb, struct iov_iter *i)
687 {
688 struct file *file = iocb->ki_filp;
689 struct netfs_i_context *ctx = netfs_i_context(file_inode(file));
690 struct folio *folio;
691 ssize_t written = 0, ret;
692 loff_t new_pos, i_size;
693 bool always_fill = false;
694
695 do {
696 size_t plen;
697 size_t offset; /* Offset into pagecache page */
698 size_t bytes; /* Bytes to write to page */
699 size_t copied; /* Bytes copied from user */
700 bool relock = false;
701
702 folio = netfs_grab_folio_for_write(file->f_mapping,
703 region->dirty.end,
704 iov_iter_count(i));
705 if (!folio)
706 return -ENOMEM;
707
708 plen = folio_size(folio);
709 offset = region->dirty.end - folio_file_pos(folio);
710 bytes = min_t(size_t, plen - offset, iov_iter_count(i));
711
712 if (!folio_test_uptodate(folio)) {
713 folio_unlock(folio); /* Avoid deadlocking fault-in */
714 relock = true;
715 }
716
717 /* Bring in the user page that we will copy from _first_.
718 * Otherwise there's a nasty deadlock on copying from the
719 * same page as we're writing to, without it being marked
720 * up-to-date.
721 *
722 * Not only is this an optimisation, but it is also required
723 * to check that the address is actually valid, when atomic
724 * usercopies are used, below.
725 */
726 if (unlikely(iov_iter_fault_in_readable(i, bytes))) {
727 ret = -EFAULT;
728 goto error_folio;
729 }
730
731 if (fatal_signal_pending(current)) {
732 ret = -EINTR;
733 goto error_folio;
734 }
735
736 if (relock) {
737 ret = folio_lock_killable(folio);
738 if (ret < 0)
739 goto error_folio;
740 }
741
742 redo_prefetch:
743 /* Prefetch area to be written into the cache if we're caching
744 * this file. We need to do this before we get a lock on the
745 * folio in case there's more than one writer competing for the
746 * same cache block.
747 */
748 if (!folio_test_uptodate(folio)) {
749 ret = netfs_prefetch_for_write(file, folio, region->dirty.end,
750 bytes, always_fill);
751 if (ret < 0) {
752 kdebug("prefetch %zx", ret);
753 goto error_folio;
754 }
755 }
756
757 if (mapping_writably_mapped(folio_file_mapping(folio)))
> 758 flush_dcache_folio(folio);
759 copied = copy_folio_from_iter_atomic(folio, offset, bytes, i);
760 flush_dcache_folio(folio);
761
762 /* Deal with a (partially) failed copy */
763 if (!folio_test_uptodate(folio)) {
764 if (copied == 0) {
765 ret = -EFAULT;
766 goto error_folio;
767 }
768 if (copied < bytes) {
769 iov_iter_revert(i, copied);
770 always_fill = true;
771 goto redo_prefetch;
772 }
773 folio_mark_uptodate(folio);
774 }
775
776 /* Update the inode size if we moved the EOF marker */
777 new_pos = region->dirty.end + copied;
778 i_size = i_size_read(file_inode(file));
779 if (new_pos > i_size) {
780 if (ctx->ops->update_i_size) {
781 ctx->ops->update_i_size(file, new_pos);
782 } else {
783 i_size_write(file_inode(file), new_pos);
> 784 fscache_update_cookie(ctx->cache, NULL);
785 }
786 }
787
788 /* Update the region appropriately */
789 if (i_size > region->i_size)
790 region->i_size = i_size;
791 smp_store_release(®ion->dirty.end, new_pos);
792
793 trace_netfs_dirty(ctx, region, NULL, netfs_dirty_trace_modified);
794 folio_mark_dirty(folio);
795 folio_unlock(folio);
796 folio_put(folio);
797 folio = NULL;
798
799 cond_resched();
800
801 written += copied;
802
803 balance_dirty_pages_ratelimited(file->f_mapping);
804 } while (iov_iter_count(i));
805
806 out:
807 if (likely(written)) {
808 iocb->ki_pos += written;
809
810 /* Flush and wait for a write that requires immediate synchronisation. */
811 if (region->type == NETFS_REGION_DSYNC) {
812 kdebug("dsync");
813 spin_lock(&ctx->lock);
814 netfs_flush_region(ctx, region, netfs_dirty_trace_flush_dsync);
815 spin_unlock(&ctx->lock);
816
817 ret = wait_on_region(region, NETFS_REGION_IS_COMPLETE);
818 if (ret < 0)
819 written = ret;
820 }
821 }
822
823 netfs_commit_write(ctx, region);
824 return written ? written : ret;
825
826 error_folio:
827 folio_unlock(folio);
828 folio_put(folio);
829 goto out;
830 }
831
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v2 4/5] soc: aspeed: Add eSPI driver
by kernel test robot
Hi Chia-Wei,
I love your patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on arm/for-next keystone/next soc/for-next rockchip/for-next arm64/for-next/core linus/master joel-aspeed/for-next v5.14-rc6 next-20210819]
[cannot apply to xlnx/master]
[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/Chia-Wei-Wang/arm-aspeed-Add-eSP...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-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
# https://github.com/0day-ci/linux/commit/cd398492dc8a9d27e1f7b546f1f4df371...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chia-Wei-Wang/arm-aspeed-Add-eSPI-support/20210819-160303
git checkout cd398492dc8a9d27e1f7b546f1f4df371f058566
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from drivers/soc/aspeed/aspeed-espi-ctrl.c:21:
drivers/soc/aspeed/aspeed-espi-perif.h: In function 'aspeed_espi_perif_pc_get_rx':
>> drivers/soc/aspeed/aspeed-espi-perif.h:106:15: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
106 | pkt = vmalloc(pkt_len);
| ^~~~~~~
| kvmalloc
>> drivers/soc/aspeed/aspeed-espi-perif.h:106:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
106 | pkt = vmalloc(pkt_len);
| ^
drivers/soc/aspeed/aspeed-espi-perif.h: In function 'aspeed_espi_perif_pc_put_tx':
drivers/soc/aspeed/aspeed-espi-perif.h:163:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
163 | pkt = vmalloc(ioc->pkt_len);
| ^
>> drivers/soc/aspeed/aspeed-espi-perif.h:202:9: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
202 | vfree(pkt);
| ^~~~~
| kfree
drivers/soc/aspeed/aspeed-espi-perif.h: In function 'aspeed_espi_perif_np_put_tx':
drivers/soc/aspeed/aspeed-espi-perif.h:230:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
230 | pkt = vmalloc(ioc->pkt_len);
| ^
In file included from drivers/soc/aspeed/aspeed-espi-ctrl.c:23:
drivers/soc/aspeed/aspeed-espi-oob.h: In function 'aspeed_espi_oob_dma_desc_get_rx':
>> drivers/soc/aspeed/aspeed-espi-oob.h:106:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
106 | pkt = vmalloc(pkt_len);
| ^
drivers/soc/aspeed/aspeed-espi-oob.h: In function 'aspeed_espi_oob_get_rx':
drivers/soc/aspeed/aspeed-espi-oob.h:203:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
203 | pkt = vmalloc(pkt_len);
| ^
drivers/soc/aspeed/aspeed-espi-oob.h: In function 'aspeed_espi_oob_dma_desc_put_tx':
>> drivers/soc/aspeed/aspeed-espi-oob.h:262:15: error: implicit declaration of function 'vzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
262 | pkt = vzalloc(ioc->pkt_len);
| ^~~~~~~
| kvzalloc
drivers/soc/aspeed/aspeed-espi-oob.h:262:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
262 | pkt = vzalloc(ioc->pkt_len);
| ^
drivers/soc/aspeed/aspeed-espi-oob.h: In function 'aspeed_espi_oob_put_tx':
drivers/soc/aspeed/aspeed-espi-oob.h:334:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
334 | pkt = vmalloc(ioc->pkt_len);
| ^
In file included from drivers/soc/aspeed/aspeed-espi-ctrl.c:24:
drivers/soc/aspeed/aspeed-espi-flash.h: In function 'aspeed_espi_flash_get_rx':
>> drivers/soc/aspeed/aspeed-espi-flash.h:119:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
119 | pkt = vmalloc(pkt_len);
| ^
drivers/soc/aspeed/aspeed-espi-flash.h: In function 'aspeed_espi_flash_put_tx':
drivers/soc/aspeed/aspeed-espi-flash.h:186:13: warning: assignment to 'uint8_t *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
186 | pkt = vmalloc(ioc->pkt_len);
| ^
drivers/soc/aspeed/aspeed-espi-ctrl.c: In function 'aspeed_espi_ctrl_probe':
drivers/soc/aspeed/aspeed-espi-ctrl.c:93:24: warning: unused variable 'scu' [-Wunused-variable]
93 | struct regmap *scu;
| ^~~
drivers/soc/aspeed/aspeed-espi-ctrl.c:90:18: warning: unused variable 'reg' [-Wunused-variable]
90 | uint32_t reg;
| ^~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +106 drivers/soc/aspeed/aspeed-espi-perif.h
46
47 static long aspeed_espi_perif_pc_get_rx(struct file *fp,
48 struct aspeed_espi_ioc *ioc,
49 struct aspeed_espi_perif *espi_perif)
50 {
51 int i, rc;
52 uint32_t reg;
53 uint32_t cyc, tag, len;
54 uint8_t *pkt;
55 uint32_t pkt_len;
56 struct espi_comm_hdr *hdr;
57 unsigned long flags;
58 struct aspeed_espi_ctrl *espi_ctrl = espi_perif->ctrl;
59
60 if (!espi_perif->rx_ready) {
61 if (fp->f_flags & O_NONBLOCK)
62 return -ENODATA;
63
64 rc = wait_event_interruptible(espi_perif->wq, espi_perif->rx_ready);
65 if (rc == -ERESTARTSYS)
66 return -EINTR;
67 }
68
69 /* common header (i.e. cycle type, tag, and length) is taken by HW */
70 regmap_read(espi_ctrl->map, ESPI_PERIF_PC_RX_CTRL, ®);
71 cyc = (reg & ESPI_PERIF_PC_RX_CTRL_CYC_MASK) >> ESPI_PERIF_PC_RX_CTRL_CYC_SHIFT;
72 tag = (reg & ESPI_PERIF_PC_RX_CTRL_TAG_MASK) >> ESPI_PERIF_PC_RX_CTRL_TAG_SHIFT;
73 len = (reg & ESPI_PERIF_PC_RX_CTRL_LEN_MASK) >> ESPI_PERIF_PC_RX_CTRL_LEN_SHIFT;
74
75 /*
76 * calculate the length of the rest part of the
77 * eSPI packet to be read from HW and copied to
78 * user space.
79 */
80 switch (cyc) {
81 case ESPI_PERIF_MSG:
82 pkt_len = len + sizeof(struct espi_perif_msg);
83 break;
84 case ESPI_PERIF_MSG_D:
85 pkt_len = ((len) ? len : ESPI_PLD_LEN_MAX) +
86 sizeof(struct espi_perif_msg);
87 break;
88 case ESPI_PERIF_SUC_CMPLT_D_MIDDLE:
89 case ESPI_PERIF_SUC_CMPLT_D_FIRST:
90 case ESPI_PERIF_SUC_CMPLT_D_LAST:
91 case ESPI_PERIF_SUC_CMPLT_D_ONLY:
92 pkt_len = ((len) ? len : ESPI_PLD_LEN_MAX) +
93 sizeof(struct espi_perif_cmplt);
94 break;
95 case ESPI_PERIF_SUC_CMPLT:
96 case ESPI_PERIF_UNSUC_CMPLT:
97 pkt_len = len + sizeof(struct espi_perif_cmplt);
98 break;
99 default:
100 return -EFAULT;
101 }
102
103 if (ioc->pkt_len < pkt_len)
104 return -EINVAL;
105
> 106 pkt = vmalloc(pkt_len);
107 if (!pkt)
108 return -ENOMEM;
109
110 hdr = (struct espi_comm_hdr *)pkt;
111 hdr->cyc = cyc;
112 hdr->tag = tag;
113 hdr->len_h = len >> 8;
114 hdr->len_l = len & 0xff;
115
116 if (espi_perif->dma_mode) {
117 memcpy(hdr + 1, espi_perif->dma.pc_rx_virt,
118 pkt_len - sizeof(*hdr));
119 } else {
120 for (i = sizeof(*hdr); i < pkt_len; ++i) {
121 regmap_read(espi_ctrl->map,
122 ESPI_PERIF_PC_RX_PORT, ®);
123 pkt[i] = reg & 0xff;
124 }
125 }
126
127 if (copy_to_user((void __user *)ioc->pkt, pkt, pkt_len))
128 return -EFAULT;
129
130 spin_lock_irqsave(&espi_perif->rx_lock, flags);
131
132 regmap_write_bits(espi_ctrl->map, ESPI_PERIF_PC_RX_CTRL,
133 ESPI_PERIF_PC_RX_CTRL_PEND_SERV,
134 ESPI_PERIF_PC_RX_CTRL_PEND_SERV);
135
136 espi_perif->rx_ready = 0;
137
138 spin_unlock_irqrestore(&espi_perif->rx_lock, flags);
139
140 return pkt_len;
141 }
142
143 static long aspeed_espi_perif_pc_put_tx(struct file *fp,
144 struct aspeed_espi_ioc *ioc,
145 struct aspeed_espi_perif *espi_perif)
146 {
147 int i, rc = 0;
148 uint32_t reg;
149 uint32_t cyc, tag, len;
150 uint8_t *pkt;
151 struct espi_comm_hdr *hdr;
152 struct aspeed_espi_ctrl *espi_ctrl = espi_perif->ctrl;
153
154 if (!mutex_trylock(&espi_perif->pc_tx_lock))
155 return -EAGAIN;
156
157 regmap_read(espi_ctrl->map, ESPI_PERIF_PC_TX_CTRL, ®);
158 if (reg & ESPI_PERIF_PC_TX_CTRL_TRIGGER) {
159 rc = -EBUSY;
160 goto unlock_n_out;
161 }
162
163 pkt = vmalloc(ioc->pkt_len);
164 if (!pkt) {
165 rc = -ENOMEM;
166 goto unlock_n_out;
167 }
168
169 hdr = (struct espi_comm_hdr *)pkt;
170
171 if (copy_from_user(pkt, (void __user *)ioc->pkt, ioc->pkt_len)) {
172 rc = -EFAULT;
173 goto free_n_out;
174 }
175
176 /*
177 * common header (i.e. cycle type, tag, and length)
178 * part is written to HW registers
179 */
180 if (espi_perif->dma_mode) {
181 memcpy(espi_perif->dma.pc_tx_virt, hdr + 1,
182 ioc->pkt_len - sizeof(*hdr));
183 dma_wmb();
184 } else {
185 for (i = sizeof(*hdr); i < ioc->pkt_len; ++i)
186 regmap_write(espi_ctrl->map,
187 ESPI_PERIF_PC_TX_PORT, pkt[i]);
188 }
189
190 cyc = hdr->cyc;
191 tag = hdr->tag;
192 len = (hdr->len_h << 8) | (hdr->len_l & 0xff);
193
194 reg = ((cyc << ESPI_PERIF_PC_TX_CTRL_CYC_SHIFT) & ESPI_PERIF_PC_TX_CTRL_CYC_MASK)
195 | ((tag << ESPI_PERIF_PC_TX_CTRL_TAG_SHIFT) & ESPI_PERIF_PC_TX_CTRL_TAG_MASK)
196 | ((len << ESPI_PERIF_PC_TX_CTRL_LEN_SHIFT) & ESPI_PERIF_PC_TX_CTRL_LEN_MASK)
197 | ESPI_PERIF_PC_TX_CTRL_TRIGGER;
198
199 regmap_write(espi_ctrl->map, ESPI_PERIF_PC_TX_CTRL, reg);
200
201 free_n_out:
> 202 vfree(pkt);
203
204 unlock_n_out:
205 mutex_unlock(&espi_perif->pc_tx_lock);
206
207 return rc;
208 }
209
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month