On 04/17/2017 at 09:10 PM, Alan Stern wrote: > On Mon, 17 Apr 2017, Greg KH wrote: > >> On Mon, Apr 17, 2017 at 11:28:44AM +0200, Andreas Hartmann wrote: >>> Hello! >>> >>> Since Linux 4.9, ums_eneub6250 is broken. It's working fine if >>> CONFIG_VMAP_STACK is disabled. >>> >>> I would be glad if it would be fixed. >> >> Ah, nice catch, thanks for finding this. >> >> Does the patch below fix this for you? >> >> thanks, >> >> greg k-h >> >> --------------------- >> >> >> diff --git a/drivers/usb/storage/ene_ub6250.c >> b/drivers/usb/storage/ene_ub6250.c >> index 369f3c24815a..6a227b142146 100644 >> --- a/drivers/usb/storage/ene_ub6250.c >> +++ b/drivers/usb/storage/ene_ub6250.c >> @@ -2180,21 +2180,29 @@ static int ene_sd_init(struct us_data *us) > >> @@ -2303,7 +2311,7 @@ static int ene_ub6250_probe(struct usb_interface *intf, > > Good start, but there are five (!) other places in this driver where > the same bug occurs, at lines 904, 1350, 1577, 2088, and 2157. Would > you like to fix them too? > > Maybe it would be easier for the driver to allocate a single 512-byte > buffer at the start, and use it for all of these I/O requests.
Yes, it doesn't work yet: Apr 17 21:57:41 notebook2 kernel: usb 1-1.1: new high-speed USB device number 3 using ehci-pci Apr 17 21:57:42 notebook2 kernel: usb 1-1.1: New USB device found, idVendor=0cf2, idProduct=6250 Apr 17 21:57:42 notebook2 kernel: usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=4 Apr 17 21:57:42 notebook2 kernel: usb 1-1.1: Product: UB6250 Apr 17 21:57:42 notebook2 kernel: usb 1-1.1: Manufacturer: ENE Flash Apr 17 21:57:42 notebook2 kernel: usb 1-1.1: SerialNumber: 606569746801 Apr 17 21:57:42 notebook2 mtp-probe[2166]: checking bus 1, device 3: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1" Apr 17 21:57:42 notebook2 mtp-probe[2166]: bus: 1, device: 3 was not an MTP device Apr 17 21:57:43 notebook2 kernel: usbcore: registered new interface driver usb-storage Apr 17 21:57:43 notebook2 kernel: usbcore: registered new interface driver uas Apr 17 21:57:43 notebook2 kernel: ums_eneub6250 1-1.1:1.0: USB Mass Storage device detected Apr 17 21:57:43 notebook2 kernel: scsi host6: usb-storage 1-1.1:1.0 Apr 17 21:57:43 notebook2 kernel: usbcore: registered new interface driver ums_eneub6250 Apr 17 21:57:44 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init1.bin Apr 17 21:57:44 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init2.bin Apr 17 21:57:44 notebook2 kernel: ------------[ cut here ]------------ Apr 17 21:57:44 notebook2 kernel: WARNING: CPU: 2 PID: 2182 at ../drivers/usb/core/hcd.c:1587 usb_hcd_map_urb_for_dma+0x4ba/0x4f0 [usbcore] Apr 17 21:57:44 notebook2 kernel: transfer buffer not dma capable Apr 17 21:57:44 notebook2 kernel: Modules linked in: ums_eneub6250 uas usb_storage binfmt_misc snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm_oss snd_pcm iTCO_wdt iTCO_vendor_support msi_wmi snd_s eq intel_powerclamp coretemp snd_seq_device kvm_intel snd_timer msi_laptop sparse_keymap rfkill kvm snd_mixer_oss ac battery irqbypass snd joydev r8169 thermal mii soundcore mei_me i2c_i801 intel_ips lpc_ich mei shpchp mfd_core i2c_smbus fjes acpi_cpufreq pcspkr tpm_tis tpm_tis_core tpm fan dm_crypt crc32c_intel serio_raw sr_mod cdrom i915 ehci_pci i2c_algo_bit ehci_hcd drm_kms_helper syscopyarea sysfillrect sysimgblt usbcore fb_sys_fops drm wmi button video dm_mirror dm_region_hash dm_log sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua Apr 17 21:57:44 notebook2 kernel: CPU: 2 PID: 2182 Comm: usb-storage Not tainted 4.9.22-1.2-default #1 Apr 17 21:57:44 notebook2 kernel: Hardware name: Micro-Star International CR620/CR620, BIOS E1681IMS VER.10C 04/12/2011 Apr 17 21:57:44 notebook2 kernel: ffffa0c840dc77c0 ffffffff813c856a ffffa0c840dc7810 0000000000000000 Apr 17 21:57:44 notebook2 kernel: ffffa0c840dc7800 ffffffff81085c71 00000633810bd0ee ffff92e6fbfa7b40 Apr 17 21:57:44 notebook2 kernel: 0000000000000000 0000000000000200 0000000000000002 ffff92e74aecf800 Apr 17 21:57:44 notebook2 kernel: Call Trace: Apr 17 21:57:44 notebook2 kernel: [<ffffffff813c856a>] dump_stack+0x63/0x89 Apr 17 21:57:44 notebook2 kernel: [<ffffffff81085c71>] __warn+0xd1/0xf0 Apr 17 21:57:44 notebook2 kernel: [<ffffffff81085cdf>] warn_slowpath_fmt+0x4f/0x60 Apr 17 21:57:44 notebook2 kernel: [<ffffffff810bdb48>] ? put_prev_entity+0x48/0x720 Apr 17 21:57:44 notebook2 kernel: [<ffffffffc027a43a>] usb_hcd_map_urb_for_dma+0x4ba/0x4f0 [usbcore] Apr 17 21:57:44 notebook2 kernel: [<ffffffff810acb58>] ? finish_task_switch+0x78/0x1e0 Apr 17 21:57:44 notebook2 kernel: [<ffffffffc027a639>] usb_hcd_submit_urb+0x1c9/0xb30 [usbcore] Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171bc0d>] ? schedule+0x3d/0x90 Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171eb10>] ? schedule_timeout+0x220/0x3c0 Apr 17 21:57:44 notebook2 kernel: [<ffffffffc027bf45>] usb_submit_urb.part.6+0x295/0x550 [usbcore] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc027c234>] usb_submit_urb+0x34/0x70 [usbcore] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc07080cd>] usb_stor_msg_common+0x9d/0x120 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc0708506>] usb_stor_bulk_transfer_buf+0x56/0xa0 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc0708a7e>] usb_stor_bulk_transfer_sg+0x4e/0x60 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc071b157>] ene_send_scsi_cmd+0x97/0x160 [ums_eneub6250] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc071b500>] ene_sd_init+0x120/0x200 [ums_eneub6250] Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171bc0d>] ? schedule+0x3d/0x90 Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171eb10>] ? schedule_timeout+0x220/0x3c0 Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171c957>] ? wait_for_completion_interruptible_timeout+0xf7/0x110 Apr 17 21:57:44 notebook2 kernel: [<ffffffff810b1390>] ? wake_up_q+0x80/0x80 Apr 17 21:57:44 notebook2 kernel: [<ffffffffc0708102>] ? usb_stor_msg_common+0xd2/0x120 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc0708539>] ? usb_stor_bulk_transfer_buf+0x89/0xa0 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc071cf1b>] ? ene_transport+0x9eb/0xa55 [ums_eneub6250] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc071cf68>] ene_transport+0xa38/0xa55 [ums_eneub6250] Apr 17 21:57:44 notebook2 kernel: [<ffffffff810d0afc>] ? cpuacct_charge+0x6c/0x80 Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171bc0d>] ? schedule+0x3d/0x90 Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171eb10>] ? schedule_timeout+0x220/0x3c0 Apr 17 21:57:44 notebook2 kernel: [<ffffffffc070902b>] usb_stor_invoke_transport+0x3b/0x4e0 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffff810bdb48>] ? put_prev_entity+0x48/0x720 Apr 17 21:57:44 notebook2 kernel: [<ffffffff8171cd04>] ? wait_for_completion_interruptible+0x124/0x150 Apr 17 21:57:44 notebook2 kernel: [<ffffffffc0707d9e>] usb_stor_transparent_scsi_command+0xe/0x10 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc070a505>] usb_stor_control_thread+0x155/0x260 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc070a3b0>] ? fill_inquiry_response+0x20/0x20 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffffc070a3b0>] ? fill_inquiry_response+0x20/0x20 [usb_storage] Apr 17 21:57:44 notebook2 kernel: [<ffffffff810a590a>] kthread+0xca/0xe0 Apr 17 21:57:44 notebook2 kernel: [<ffffffff810a5840>] ? kthread_park+0x60/0x60 Apr 17 21:57:44 notebook2 kernel: [<ffffffff81720875>] ret_from_fork+0x25/0x30 Apr 17 21:57:44 notebook2 kernel: ---[ end trace ea3297da6a6c6577 ]--- Apr 17 21:57:44 notebook2 kernel: scsi 6:0:0:0: Direct-Access "D @ "D PQ: 0 ANSI: 2 CCS Apr 17 21:57:44 notebook2 kernel: scsi 6:0:0:0: alua: supports implicit TPGS Apr 17 21:57:44 notebook2 kernel: scsi 6:0:0:0: alua: No target port descriptors found Apr 17 21:57:44 notebook2 kernel: scsi 6:0:0:0: alua: Attach failed (-22) Apr 17 21:57:44 notebook2 kernel: scsi 6:0:0:0: failed to add device handler: -22 Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0 Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] Sector size 0 reported, assuming 512. Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] 1 512-byte logical blocks: (512 B/512 B) Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] 0-byte physical blocks Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] Write Protect is off Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] Mode Sense: 00 00 00 00 Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] Asking for cache data failed Apr 17 21:57:44 notebook2 kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through Apr 17 21:57:54 notebook2 kernel: usb 1-1.1: reset high-speed USB device number 3 using ehci-pci Apr 17 21:57:55 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init1.bin Apr 17 21:57:55 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init2.bin Apr 17 21:57:55 notebook2 kernel: sdb: detected capacity change from 512 to 944015872 Apr 17 21:58:26 notebook2 kernel: usb 1-1.1: reset high-speed USB device number 3 using ehci-pci Apr 17 21:58:26 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init1.bin Apr 17 21:58:26 notebook2 kernel: usb 1-1.1: direct-loading ene-ub6250/sd_init2.bin Apr 17 21:58:55 notebook2 kernel: usb 1-1.1: USB disconnect, device number 3 Apr 17 21:58:55 notebook2 kernel: sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK Apr 17 21:58:55 notebook2 kernel: sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 1f 00 00 01 00 Apr 17 21:58:55 notebook2 kernel: blk_update_request: I/O error, dev sdb, sector 31 Apr 17 21:58:55 notebook2 kernel: Buffer I/O error on dev sdb, logical block 31, async page read Apr 17 21:58:55 notebook2 kernel: sdb: unable to read partition table Apr 17 21:58:55 notebook2 kernel: sd 6:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK Apr 17 21:58:55 notebook2 kernel: sd 6:0:0:0: [sdb] Sense not available. Apr 17 21:58:55 notebook2 kernel: sd 6:0:0:0: [sdb] Attached SCSI removable disk Thanks, regards, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html