USB flash drive constantly disconnects/reconnects accidentally

Set kernel parameters as suggested here:

Now have another problem USB flash drive constantly disconnects/reconnects accidentally. Now have caught it again, so more detailed output from dmesg:

 5093.018665] usb 3-1: USB disconnect, device number 5
 5093.019038] print_req_error: 121 callbacks suppressed
 5093.019039] print_req_error: I/O error, dev sdc, sector 24489416 flags 4001
 5093.019043] buffer_io_error: 12415 callbacks suppressed
 5093.019045] Buffer I/O error on dev sdc1, logical block 3060921, lost async page write
 5093.019049] Buffer I/O error on dev sdc1, logical block 3060922, lost async page write
 5093.019051] Buffer I/O error on dev sdc1, logical block 3060923, lost async page write
 5093.019053] Buffer I/O error on dev sdc1, logical block 3060924, lost async page write
 5093.019056] Buffer I/O error on dev sdc1, logical block 3060925, lost async page write
 5093.019058] Buffer I/O error on dev sdc1, logical block 3060926, lost async page write
 5093.019059] Buffer I/O error on dev sdc1, logical block 3060927, lost async page write
 5093.019061] Buffer I/O error on dev sdc1, logical block 3060928, lost async page write
 5093.019063] Buffer I/O error on dev sdc1, logical block 3060929, lost async page write
 5093.019065] Buffer I/O error on dev sdc1, logical block 3060930, lost async page write
 5093.019239] print_req_error: I/O error, dev sdc, sector 24491464 flags 4001
 5093.019482] print_req_error: I/O error, dev sdc, sector 5192 flags 1
 5093.019517] print_req_error: I/O error, dev sdc, sector 5248 flags 0
 5093.027553] print_req_error: I/O error, dev sdc, sector 24493512 flags 4001
 5093.027815] print_req_error: I/O error, dev sdc, sector 24495560 flags 4001
 5093.028067] print_req_error: I/O error, dev sdc, sector 24497608 flags 1
 5093.028113] print_req_error: I/O error, dev sdc, sector 24497616 flags 1
 5093.028157] print_req_error: I/O error, dev sdc, sector 24497744 flags 1
 5093.028484] print_req_error: I/O error, dev sdc, sector 24497888 flags 4001
 5093.563847] ------------ cut here ]------------
 5093.563850] bdi-block not registered
 5093.563876] WARNING: CPU: 1 PID: 12025 at fs/fs-writeback.c:2220 __mark_inode_dirty+0x291/0x380
 5093.563876] Modules linked in: af_packet nf_log_ipv6 nf_log_ipv4  nf_log_common xt_LOG xt_limit xt_comment scsi_transport_iscsi xt_pkttype  xt_tcpudp ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4  iptable_filter bpfilter ip6table_mangle nf_conntrack_netbios_ns  nf_conntrack_broadcast ip_tables xt_conntrack nf_conntrack  nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6table_filter ip6_tables  x_tables binfmt_misc msr fuse joydev uvcvideo videobuf2_vmalloc  videobuf2_memops videobuf2_v4l2 videodev pktcdvd edac_mce_amd  hid_generic kvm_amd snd_usb_audio ccp usbhid videobuf2_common usblp  snd_usbmidi_lib kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel  ghash_clmulni_intel sp5100_tco r8169 aesni_intel snd_cmipci  snd_mpu401_uart snd_opl3_lib pcspkr snd_rawmidi realtek snd_seq_device  libphy gameport 8139too 8139cp aes_x86_64 i2c_piix4 mii fam15h_power  k10temp crypto_simd cryptd glue_helper pcc_cpufreq button acpi_cpufreq  snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic
 5093.563909]  ledtrig_audio snd_hda_intel snd_hda_codec snd_hda_core  snd_hwdep snd_pcm snd_timer snd soundcore uas usb_storage  nvidia_drm(POE) nvidia_modeset(POE) ohci_pci nvidia_uvm(POE) nvidia(POE)  drm_kms_helper drm xhci_pci xhci_hcd ohci_hcd ehci_pci ehci_hcd  syscopyarea sysfillrect sysimgblt fb_sys_fops sr_mod ipmi_devintf cdrom  usbcore ipmi_msghandler l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel  udp_tunnel pppox ppp_generic slhc sg dm_multipath dm_mod scsi_dh_rdac  scsi_dh_emc scsi_dh_alua
 5093.563931] CPU: 1 PID: 12025 Comm: mount.exfat Tainted: P            OE     5.0.5-1-default #1 openSUSE Tumbleweed (unreleased)
 5093.563931] Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./970A-DS3P, BIOS FD 02/26/2016
 5093.563934] RIP: 0010:__mark_inode_dirty+0x291/0x380
 5093.563935] Code: f5 f2 ff ff 49 89 c4 48 8b 00 f6 40 3c 02 75 1c 49  8b 54 24 08 83 e2 01 75 12 48 8b 70 30 48 c7 c7 74 b3 0a bd e8 b9 19 de  ff <0f> 0b 48 8b 05 a6 6e f5 00 48 89 85 c8 00 00 00 45 85 ff 74  0e 48
 5093.563936] RSP: 0018:ffffb4b3c5f0fc80 EFLAGS: 00010282
 5093.563937] RAX: 0000000000000018 RBX: 0000000000000000 RCX: 0000000000000006
 5093.563938] RDX: 0000000000000007 RSI: 0000000000000086 RDI: ffff934c9ea56a10
 5093.563939] RBP: ffff934ba430d818 R08: 00000000000004ff R09: 0000000000000004
 5093.563940] R10: 0000000000000000 R11: 0000000000000001 R12: ffff934b80801c58
 5093.563941] R13: ffff934ba430d8a0 R14: 0000000000000000 R15: 0000000000000000
 5093.563942] FS:  00007f9e1205eb80(0000) GS:ffff934c9ea40000(0000) knlGS:0000000000000000
 5093.563943] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 5093.563943] CR2: 00007f40634c2480 CR3: 00000001331d8000 CR4: 00000000000406e0
 5093.563944] Call Trace:
 5093.563952]  __block_commit_write.isra.39+0x4c/0xa0
 5093.563955]  block_write_end+0x2f/0x80
 5093.563958]  ? iov_iter_copy_from_user_atomic+0x105/0x340
 5093.563960]  blkdev_write_end+0x13/0x80
 5093.563962]  generic_perform_write+0x113/0x180
 5093.563964]  __generic_file_write_iter+0xfa/0x1c0
 5093.563967]  ? wait_woken+0x80/0x80
 5093.563968]  blkdev_write_iter+0x8c/0x100
 5093.563972]  __vfs_write+0x129/0x190
 5093.563974]  vfs_write+0xa5/0x1a0
 5093.563976]  ksys_pwrite64+0x61/0xa0
 5093.563979]  do_syscall_64+0x60/0x110
 5093.563981]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
 5093.563983] RIP: 0033:0x7f9e11f82fe4
 5093.563985] Code: c0 ff ff ff ff eb b6 66 2e 0f 1f 84 00 00 00 00 00  0f 1f 44 00 00 8b 05 8a d1 00 00 49 89 ca 85 c0 75 13 b8 12 00 00 00 0f  05 <48> 3d 00 f0 ff ff 77 5c c3 0f 1f 00 41 55 49 89 cd 41 54 49  89 d4
 5093.563985] RSP: 002b:00007ffda94f98c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
 5093.563987] RAX: ffffffffffffffda RBX: 0000564c472df3c0 RCX: 00007f9e11f82fe4
 5093.563987] RDX: 000000000001ce40 RSI: 0000564c47778b10 RDI: 0000000000000003
 5093.563988] RBP: 0000000000000000 R08: 00007f9e11fc7da0 R09: 0000000000000007
 5093.563989] R10: 00000000003b0000 R11: 0000000000000246 R12: 0000564c4782d200
 5093.563990] R13: 0000564c477963c0 R14: 0000000000000000 R15: 0000000000000000
 5093.563991] --- end trace e7f4b36c735cdf0a ]---
 5093.826817] usb 3-1: new SuperSpeed Gen 1 USB device number 6 using xhci_hcd
 5093.848415] usb 3-1: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
 5093.848421] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 5093.848424] usb 3-1: Product: DataTraveler 3.0
 5093.848427] usb 3-1: Manufacturer: Kingston
 5093.848429] usb 3-1: SerialNumber: 902B341D9F41E2A1D90C1484
 5093.849545] usb-storage 3-1:1.0: USB Mass Storage device detected
 5093.849742] scsi host6: usb-storage 3-1:1.0
 5094.875456] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
 5094.875973] sd 6:0:0:0: Attached scsi generic sg3 type 0
 5094.876089] sd 6:0:0:0: [sdc] 60604416 512-byte logical blocks: (31.0 GB/28.9 GiB)
 5094.876363] sd 6:0:0:0: [sdc] Write Protect is off
 5094.876366] sd 6:0:0:0: [sdc] Mode Sense: 45 00 00 00
 5094.876638] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 5094.876642] sd 6:0:0:0: [sdc] Optimal transfer size 0 bytes < PAGE_SIZE (4096 bytes)
 5094.886184]  sdc: sdc1
 5094.887884] sd 6:0:0:0: [sdc] Attached SCSI removable disk

Any ideas how to solve?

This to me looks like a faulty USB drive. Try some other USB stick and see if it behaves the same. Before that you can try to use a different USB port, if you haven’t already done so.

And, the usual question: was TW upgraded by ‘zypper dup’? No other method is supported

Only ‘zypper dup’! Will try other USB stick of course.

Broken USB can cause considerable headache: https://karlmistelberger.wordpress.com/2009/03/25/wunsch-dir-was-ga-ma78g-ds3h/You may try to turn off anything related to USB in BIOS/UEFI. I returned or replaced several main boards where defective USB hardware interfered with normal operation.

I assume that’s on your GA970 based machine. I guess you’re probably using the front panel USB ports, check that the cable to the header on the motherboard is firmly seated and a good fit, I’ve seen a similar problem on a “no-name” case that had, how shall I say, a rather low build quality.

Try one of the back panel ports and see if it still occurs, but as “Knurpht” wrote, it could well be a faulty USB stick.

I’m using back panel USB3 ports, front one are USB2. Case is good - LogicPower. Tried USB3 card reader - not reproducible, attached USB2 stick (have no other USB3 stick to check) to same port - not reproducible as well. So could be fault USB3 stick: worked strange from the beginning.

Looking more likely… any chance of trying that stick in a different PC, just to prove it.

You’ll have to add a new USB3 stick to your wish list :slight_smile:

Yes, need new one :slight_smile: Other PC has only USB 2 ports, not sure if it will be reproducible.