--- zzzz-none-000/linux-4.9.276/drivers/usb/storage/scsiglue.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/drivers/usb/storage/scsiglue.c 2023-04-05 08:19:02.000000000 +0000 @@ -589,8 +589,37 @@ } static DEVICE_ATTR_RW(max_sectors); +#if defined (CONFIG_AVM_USB_SUSPEND) +/* Output routine for the sysfs max_spinup_ms file */ +static ssize_t show_max_spinup_ms(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct us_data *us = host_to_us(dev_to_shost(dev)); + + return sprintf(buf, "%u\n", us->max_spinup_ms); +} + +/* Input routine for the sysfs max_sectors file */ +static ssize_t store_max_spinup_ms(struct device *dev, struct device_attribute *attr, const char *buf, + size_t count) +{ + struct us_data *us = host_to_us(dev_to_shost(dev)); + unsigned int ms; + + if (sscanf(buf, "%u", &ms) > 0) { + us->max_spinup_ms = ms; + return count; + } + return -EINVAL; +} + +static DEVICE_ATTR(max_spinup_ms, S_IRUGO | S_IWUSR, show_max_spinup_ms, store_max_spinup_ms); +#endif + static struct device_attribute *sysfs_device_attr_list[] = { &dev_attr_max_sectors, +#if defined (CONFIG_AVM_USB_SUSPEND) + &dev_attr_max_spinup_ms, +#endif NULL, }; @@ -645,7 +674,14 @@ * and Apple Mac OS X 10.11 limiting transfers to 256 sectors for USB2 * and 2048 for USB3 devices. */ +#if defined (CONFIG_AVM_KERNEL) + /* == AVM/WK 20160420 - further transfer speed optimization == */ + /* limit the total size of a transfer to 512 KB to reduce USB irqs */ + .max_sectors = 1024, +#else + /* limit the total size of a transfer to 120 KB */ .max_sectors = 240, +#endif /* * merge commands... this seems to help performance, but