diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/acpi/osl.c | 2 | ||||
| -rw-r--r-- | drivers/edac/edac_mc.c | 6 | ||||
| -rw-r--r-- | drivers/edac/edac_pci_sysfs.c | 2 | ||||
| -rw-r--r-- | drivers/firmware/dmi_scan.c | 2 | ||||
| -rw-r--r-- | drivers/firmware/efivars.c | 9 | ||||
| -rw-r--r-- | drivers/firmware/iscsi_ibft_find.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 3 | ||||
| -rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
| -rw-r--r-- | drivers/hid/i2c-hid/i2c-hid.c | 13 | ||||
| -rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 1 | ||||
| -rw-r--r-- | drivers/md/dm-thin.c | 13 | ||||
| -rw-r--r-- | drivers/md/dm.c | 6 | ||||
| -rw-r--r-- | drivers/platform/x86/ibm_rtl.c | 2 | ||||
| -rw-r--r-- | drivers/platform/x86/samsung-laptop.c | 4 | ||||
| -rw-r--r-- | drivers/scsi/isci/init.c | 2 | ||||
| -rw-r--r-- | drivers/target/target_core_device.c | 8 | ||||
| -rw-r--r-- | drivers/target/target_core_fabric_configfs.c | 5 | ||||
| -rw-r--r-- | drivers/target/target_core_sbc.c | 18 | ||||
| -rw-r--r-- | drivers/target/target_core_spc.c | 44 | ||||
| -rw-r--r-- | drivers/vhost/tcm_vhost.c | 4 |
20 files changed, 73 insertions, 76 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 3ff267861541..bd22f8667eed 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
| @@ -250,7 +250,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) | |||
| 250 | return acpi_rsdp; | 250 | return acpi_rsdp; |
| 251 | #endif | 251 | #endif |
| 252 | 252 | ||
| 253 | if (efi_enabled) { | 253 | if (efi_enabled(EFI_CONFIG_TABLES)) { |
| 254 | if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) | 254 | if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) |
| 255 | return efi.acpi20; | 255 | return efi.acpi20; |
| 256 | else if (efi.acpi != EFI_INVALID_TABLE_ADDR) | 256 | else if (efi.acpi != EFI_INVALID_TABLE_ADDR) |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 281f566a5513..d1e9eb191f2b 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
| @@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, | |||
| 340 | /* | 340 | /* |
| 341 | * Alocate and fill the csrow/channels structs | 341 | * Alocate and fill the csrow/channels structs |
| 342 | */ | 342 | */ |
| 343 | mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL); | 343 | mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL); |
| 344 | if (!mci->csrows) | 344 | if (!mci->csrows) |
| 345 | goto error; | 345 | goto error; |
| 346 | for (row = 0; row < tot_csrows; row++) { | 346 | for (row = 0; row < tot_csrows; row++) { |
| @@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, | |||
| 351 | csr->csrow_idx = row; | 351 | csr->csrow_idx = row; |
| 352 | csr->mci = mci; | 352 | csr->mci = mci; |
| 353 | csr->nr_channels = tot_channels; | 353 | csr->nr_channels = tot_channels; |
| 354 | csr->channels = kcalloc(sizeof(*csr->channels), tot_channels, | 354 | csr->channels = kcalloc(tot_channels, sizeof(*csr->channels), |
| 355 | GFP_KERNEL); | 355 | GFP_KERNEL); |
| 356 | if (!csr->channels) | 356 | if (!csr->channels) |
| 357 | goto error; | 357 | goto error; |
| @@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, | |||
| 369 | /* | 369 | /* |
| 370 | * Allocate and fill the dimm structs | 370 | * Allocate and fill the dimm structs |
| 371 | */ | 371 | */ |
| 372 | mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL); | 372 | mci->dimms = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL); |
| 373 | if (!mci->dimms) | 373 | if (!mci->dimms) |
| 374 | goto error; | 374 | goto error; |
| 375 | 375 | ||
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index dc6e905ee1a5..0056c4dae9d5 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c | |||
| @@ -256,7 +256,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj, | |||
| 256 | struct edac_pci_dev_attribute *edac_pci_dev; | 256 | struct edac_pci_dev_attribute *edac_pci_dev; |
| 257 | edac_pci_dev = (struct edac_pci_dev_attribute *)attr; | 257 | edac_pci_dev = (struct edac_pci_dev_attribute *)attr; |
| 258 | 258 | ||
| 259 | if (edac_pci_dev->show) | 259 | if (edac_pci_dev->store) |
| 260 | return edac_pci_dev->store(edac_pci_dev->value, buffer, count); | 260 | return edac_pci_dev->store(edac_pci_dev->value, buffer, count); |
| 261 | return -EIO; | 261 | return -EIO; |
| 262 | } | 262 | } |
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index fd3ae6290d71..982f1f5f5742 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
| @@ -471,7 +471,7 @@ void __init dmi_scan_machine(void) | |||
| 471 | char __iomem *p, *q; | 471 | char __iomem *p, *q; |
| 472 | int rc; | 472 | int rc; |
| 473 | 473 | ||
| 474 | if (efi_enabled) { | 474 | if (efi_enabled(EFI_CONFIG_TABLES)) { |
| 475 | if (efi.smbios == EFI_INVALID_TABLE_ADDR) | 475 | if (efi.smbios == EFI_INVALID_TABLE_ADDR) |
| 476 | goto error; | 476 | goto error; |
| 477 | 477 | ||
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 7b1c37497c9a..f5596db0cf58 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
| @@ -674,7 +674,7 @@ static int efi_status_to_err(efi_status_t status) | |||
| 674 | err = -EACCES; | 674 | err = -EACCES; |
| 675 | break; | 675 | break; |
| 676 | case EFI_NOT_FOUND: | 676 | case EFI_NOT_FOUND: |
| 677 | err = -ENOENT; | 677 | err = -EIO; |
| 678 | break; | 678 | break; |
| 679 | default: | 679 | default: |
| 680 | err = -EINVAL; | 680 | err = -EINVAL; |
| @@ -793,6 +793,7 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
| 793 | spin_unlock(&efivars->lock); | 793 | spin_unlock(&efivars->lock); |
| 794 | efivar_unregister(var); | 794 | efivar_unregister(var); |
| 795 | drop_nlink(inode); | 795 | drop_nlink(inode); |
| 796 | d_delete(file->f_dentry); | ||
| 796 | dput(file->f_dentry); | 797 | dput(file->f_dentry); |
| 797 | 798 | ||
| 798 | } else { | 799 | } else { |
| @@ -994,7 +995,7 @@ static int efivarfs_unlink(struct inode *dir, struct dentry *dentry) | |||
| 994 | list_del(&var->list); | 995 | list_del(&var->list); |
| 995 | spin_unlock(&efivars->lock); | 996 | spin_unlock(&efivars->lock); |
| 996 | efivar_unregister(var); | 997 | efivar_unregister(var); |
| 997 | drop_nlink(dir); | 998 | drop_nlink(dentry->d_inode); |
| 998 | dput(dentry); | 999 | dput(dentry); |
| 999 | return 0; | 1000 | return 0; |
| 1000 | } | 1001 | } |
| @@ -1782,7 +1783,7 @@ efivars_init(void) | |||
| 1782 | printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, | 1783 | printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, |
| 1783 | EFIVARS_DATE); | 1784 | EFIVARS_DATE); |
| 1784 | 1785 | ||
| 1785 | if (!efi_enabled) | 1786 | if (!efi_enabled(EFI_RUNTIME_SERVICES)) |
| 1786 | return 0; | 1787 | return 0; |
| 1787 | 1788 | ||
| 1788 | /* For now we'll register the efi directory at /sys/firmware/efi */ | 1789 | /* For now we'll register the efi directory at /sys/firmware/efi */ |
| @@ -1822,7 +1823,7 @@ err_put: | |||
| 1822 | static void __exit | 1823 | static void __exit |
| 1823 | efivars_exit(void) | 1824 | efivars_exit(void) |
| 1824 | { | 1825 | { |
| 1825 | if (efi_enabled) { | 1826 | if (efi_enabled(EFI_RUNTIME_SERVICES)) { |
| 1826 | unregister_efivars(&__efivars); | 1827 | unregister_efivars(&__efivars); |
| 1827 | kobject_put(efi_kobj); | 1828 | kobject_put(efi_kobj); |
| 1828 | } | 1829 | } |
diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c index 4da4eb9ae926..2224f1dc074b 100644 --- a/drivers/firmware/iscsi_ibft_find.c +++ b/drivers/firmware/iscsi_ibft_find.c | |||
| @@ -99,7 +99,7 @@ unsigned long __init find_ibft_region(unsigned long *sizep) | |||
| 99 | /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will | 99 | /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will |
| 100 | * only use ACPI for this */ | 100 | * only use ACPI for this */ |
| 101 | 101 | ||
| 102 | if (!efi_enabled) | 102 | if (!efi_enabled(EFI_BOOT)) |
| 103 | find_ibft_in_mem(); | 103 | find_ibft_in_mem(); |
| 104 | 104 | ||
| 105 | if (ibft_addr) { | 105 | if (ibft_addr) { |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index edfc54e41842..0d6562bb0c93 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -429,7 +429,8 @@ bool radeon_card_posted(struct radeon_device *rdev) | |||
| 429 | { | 429 | { |
| 430 | uint32_t reg; | 430 | uint32_t reg; |
| 431 | 431 | ||
| 432 | if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) | 432 | if (efi_enabled(EFI_BOOT) && |
| 433 | rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) | ||
| 433 | return false; | 434 | return false; |
| 434 | 435 | ||
| 435 | /* first check CRTCs */ | 436 | /* first check CRTCs */ |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 4dfa605e2d14..34e25471aeaa 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -306,6 +306,9 @@ | |||
| 306 | #define USB_VENDOR_ID_EZKEY 0x0518 | 306 | #define USB_VENDOR_ID_EZKEY 0x0518 |
| 307 | #define USB_DEVICE_ID_BTC_8193 0x0002 | 307 | #define USB_DEVICE_ID_BTC_8193 0x0002 |
| 308 | 308 | ||
| 309 | #define USB_VENDOR_ID_FORMOSA 0x147a | ||
| 310 | #define USB_DEVICE_ID_FORMOSA_IR_RECEIVER 0xe03e | ||
| 311 | |||
| 309 | #define USB_VENDOR_ID_FREESCALE 0x15A2 | 312 | #define USB_VENDOR_ID_FREESCALE 0x15A2 |
| 310 | #define USB_DEVICE_ID_FREESCALE_MX28 0x004F | 313 | #define USB_DEVICE_ID_FREESCALE_MX28 0x004F |
| 311 | 314 | ||
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 12e4fdc810bf..e766b5614ef5 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
| @@ -540,13 +540,24 @@ static int i2c_hid_output_raw_report(struct hid_device *hid, __u8 *buf, | |||
| 540 | { | 540 | { |
| 541 | struct i2c_client *client = hid->driver_data; | 541 | struct i2c_client *client = hid->driver_data; |
| 542 | int report_id = buf[0]; | 542 | int report_id = buf[0]; |
| 543 | int ret; | ||
| 543 | 544 | ||
| 544 | if (report_type == HID_INPUT_REPORT) | 545 | if (report_type == HID_INPUT_REPORT) |
| 545 | return -EINVAL; | 546 | return -EINVAL; |
| 546 | 547 | ||
| 547 | return i2c_hid_set_report(client, | 548 | if (report_id) { |
| 549 | buf++; | ||
| 550 | count--; | ||
| 551 | } | ||
| 552 | |||
| 553 | ret = i2c_hid_set_report(client, | ||
| 548 | report_type == HID_FEATURE_REPORT ? 0x03 : 0x02, | 554 | report_type == HID_FEATURE_REPORT ? 0x03 : 0x02, |
| 549 | report_id, buf, count); | 555 | report_id, buf, count); |
| 556 | |||
| 557 | if (report_id && ret >= 0) | ||
| 558 | ret++; /* add report_id to the number of transfered bytes */ | ||
| 559 | |||
| 560 | return ret; | ||
| 550 | } | 561 | } |
| 551 | 562 | ||
| 552 | static int i2c_hid_parse(struct hid_device *hid) | 563 | static int i2c_hid_parse(struct hid_device *hid) |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index ac9e35228254..e0e6abf1cd3b 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
| @@ -70,6 +70,7 @@ static const struct hid_blacklist { | |||
| 70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, | 70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, |
| 71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
| 72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
| 73 | { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, | ||
| 73 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, | 74 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, |
| 74 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, | 75 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, |
| 75 | { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, | 76 | { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 675ae5274016..5409607d4875 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
| @@ -2746,19 +2746,9 @@ static int thin_iterate_devices(struct dm_target *ti, | |||
| 2746 | return 0; | 2746 | return 0; |
| 2747 | } | 2747 | } |
| 2748 | 2748 | ||
| 2749 | /* | ||
| 2750 | * A thin device always inherits its queue limits from its pool. | ||
| 2751 | */ | ||
| 2752 | static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) | ||
| 2753 | { | ||
| 2754 | struct thin_c *tc = ti->private; | ||
| 2755 | |||
| 2756 | *limits = bdev_get_queue(tc->pool_dev->bdev)->limits; | ||
| 2757 | } | ||
| 2758 | |||
| 2759 | static struct target_type thin_target = { | 2749 | static struct target_type thin_target = { |
| 2760 | .name = "thin", | 2750 | .name = "thin", |
| 2761 | .version = {1, 6, 0}, | 2751 | .version = {1, 7, 0}, |
| 2762 | .module = THIS_MODULE, | 2752 | .module = THIS_MODULE, |
| 2763 | .ctr = thin_ctr, | 2753 | .ctr = thin_ctr, |
| 2764 | .dtr = thin_dtr, | 2754 | .dtr = thin_dtr, |
| @@ -2767,7 +2757,6 @@ static struct target_type thin_target = { | |||
| 2767 | .postsuspend = thin_postsuspend, | 2757 | .postsuspend = thin_postsuspend, |
| 2768 | .status = thin_status, | 2758 | .status = thin_status, |
| 2769 | .iterate_devices = thin_iterate_devices, | 2759 | .iterate_devices = thin_iterate_devices, |
| 2770 | .io_hints = thin_io_hints, | ||
| 2771 | }; | 2760 | }; |
| 2772 | 2761 | ||
| 2773 | /*----------------------------------------------------------------*/ | 2762 | /*----------------------------------------------------------------*/ |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index c72e4d5a9617..314a0e2faf79 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
| @@ -1188,6 +1188,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
| 1188 | { | 1188 | { |
| 1189 | struct dm_target *ti; | 1189 | struct dm_target *ti; |
| 1190 | sector_t len; | 1190 | sector_t len; |
| 1191 | unsigned num_requests; | ||
| 1191 | 1192 | ||
| 1192 | do { | 1193 | do { |
| 1193 | ti = dm_table_find_target(ci->map, ci->sector); | 1194 | ti = dm_table_find_target(ci->map, ci->sector); |
| @@ -1200,7 +1201,8 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
| 1200 | * reconfiguration might also have changed that since the | 1201 | * reconfiguration might also have changed that since the |
| 1201 | * check was performed. | 1202 | * check was performed. |
| 1202 | */ | 1203 | */ |
| 1203 | if (!get_num_requests || !get_num_requests(ti)) | 1204 | num_requests = get_num_requests ? get_num_requests(ti) : 0; |
| 1205 | if (!num_requests) | ||
| 1204 | return -EOPNOTSUPP; | 1206 | return -EOPNOTSUPP; |
| 1205 | 1207 | ||
| 1206 | if (is_split_required && !is_split_required(ti)) | 1208 | if (is_split_required && !is_split_required(ti)) |
| @@ -1208,7 +1210,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
| 1208 | else | 1210 | else |
| 1209 | len = min(ci->sector_count, max_io_len(ci->sector, ti)); | 1211 | len = min(ci->sector_count, max_io_len(ci->sector, ti)); |
| 1210 | 1212 | ||
| 1211 | __issue_target_requests(ci, ti, ti->num_discard_requests, len); | 1213 | __issue_target_requests(ci, ti, num_requests, len); |
| 1212 | 1214 | ||
| 1213 | ci->sector += len; | 1215 | ci->sector += len; |
| 1214 | } while (ci->sector_count -= len); | 1216 | } while (ci->sector_count -= len); |
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 7481146a5b47..97c2be195efc 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c | |||
| @@ -244,7 +244,7 @@ static int __init ibm_rtl_init(void) { | |||
| 244 | if (force) | 244 | if (force) |
| 245 | pr_warn("module loaded by force\n"); | 245 | pr_warn("module loaded by force\n"); |
| 246 | /* first ensure that we are running on IBM HW */ | 246 | /* first ensure that we are running on IBM HW */ |
| 247 | else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table)) | 247 | else if (efi_enabled(EFI_BOOT) || !dmi_check_system(ibm_rtl_dmi_table)) |
| 248 | return -ENODEV; | 248 | return -ENODEV; |
| 249 | 249 | ||
| 250 | /* Get the address for the Extended BIOS Data Area */ | 250 | /* Get the address for the Extended BIOS Data Area */ |
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 71623a2ff3e8..d1f030053176 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
| 27 | #include <linux/debugfs.h> | 27 | #include <linux/debugfs.h> |
| 28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
| 29 | #include <linux/efi.h> | ||
| 29 | #include <acpi/video.h> | 30 | #include <acpi/video.h> |
| 30 | 31 | ||
| 31 | /* | 32 | /* |
| @@ -1544,6 +1545,9 @@ static int __init samsung_init(void) | |||
| 1544 | struct samsung_laptop *samsung; | 1545 | struct samsung_laptop *samsung; |
| 1545 | int ret; | 1546 | int ret; |
| 1546 | 1547 | ||
| 1548 | if (efi_enabled(EFI_BOOT)) | ||
| 1549 | return -ENODEV; | ||
| 1550 | |||
| 1547 | quirks = &samsung_unknown; | 1551 | quirks = &samsung_unknown; |
| 1548 | if (!force && !dmi_check_system(samsung_dmi_table)) | 1552 | if (!force && !dmi_check_system(samsung_dmi_table)) |
| 1549 | return -ENODEV; | 1553 | return -ENODEV; |
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index d73fdcfeb45a..2839baa82a5a 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
| @@ -633,7 +633,7 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 633 | return -ENOMEM; | 633 | return -ENOMEM; |
| 634 | pci_set_drvdata(pdev, pci_info); | 634 | pci_set_drvdata(pdev, pci_info); |
| 635 | 635 | ||
| 636 | if (efi_enabled) | 636 | if (efi_enabled(EFI_RUNTIME_SERVICES)) |
| 637 | orom = isci_get_efi_var(pdev); | 637 | orom = isci_get_efi_var(pdev); |
| 638 | 638 | ||
| 639 | if (!orom) | 639 | if (!orom) |
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index e2695101bb99..f2aa7543d20a 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
| @@ -941,6 +941,8 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth) | |||
| 941 | 941 | ||
| 942 | int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) | 942 | int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) |
| 943 | { | 943 | { |
| 944 | int block_size = dev->dev_attrib.block_size; | ||
| 945 | |||
| 944 | if (dev->export_count) { | 946 | if (dev->export_count) { |
| 945 | pr_err("dev[%p]: Unable to change SE Device" | 947 | pr_err("dev[%p]: Unable to change SE Device" |
| 946 | " fabric_max_sectors while export_count is %d\n", | 948 | " fabric_max_sectors while export_count is %d\n", |
| @@ -978,8 +980,12 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) | |||
| 978 | /* | 980 | /* |
| 979 | * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() | 981 | * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() |
| 980 | */ | 982 | */ |
| 983 | if (!block_size) { | ||
| 984 | block_size = 512; | ||
| 985 | pr_warn("Defaulting to 512 for zero block_size\n"); | ||
| 986 | } | ||
| 981 | fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors, | 987 | fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors, |
| 982 | dev->dev_attrib.block_size); | 988 | block_size); |
| 983 | 989 | ||
| 984 | dev->dev_attrib.fabric_max_sectors = fabric_max_sectors; | 990 | dev->dev_attrib.fabric_max_sectors = fabric_max_sectors; |
| 985 | pr_debug("dev[%p]: SE Device max_sectors changed to %u\n", | 991 | pr_debug("dev[%p]: SE Device max_sectors changed to %u\n", |
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 810263dfa4a1..c57bbbc7a7d1 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c | |||
| @@ -754,6 +754,11 @@ static int target_fabric_port_link( | |||
| 754 | return -EFAULT; | 754 | return -EFAULT; |
| 755 | } | 755 | } |
| 756 | 756 | ||
| 757 | if (!(dev->dev_flags & DF_CONFIGURED)) { | ||
| 758 | pr_err("se_device not configured yet, cannot port link\n"); | ||
| 759 | return -ENODEV; | ||
| 760 | } | ||
| 761 | |||
| 757 | tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; | 762 | tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; |
| 758 | se_tpg = container_of(to_config_group(tpg_ci), | 763 | se_tpg = container_of(to_config_group(tpg_ci), |
| 759 | struct se_portal_group, tpg_group); | 764 | struct se_portal_group, tpg_group); |
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 26a6d183ccb1..a664c664a31a 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
| @@ -58,11 +58,10 @@ sbc_emulate_readcapacity(struct se_cmd *cmd) | |||
| 58 | buf[7] = dev->dev_attrib.block_size & 0xff; | 58 | buf[7] = dev->dev_attrib.block_size & 0xff; |
| 59 | 59 | ||
| 60 | rbuf = transport_kmap_data_sg(cmd); | 60 | rbuf = transport_kmap_data_sg(cmd); |
| 61 | if (!rbuf) | 61 | if (rbuf) { |
| 62 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 62 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
| 63 | 63 | transport_kunmap_data_sg(cmd); | |
| 64 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 64 | } |
| 65 | transport_kunmap_data_sg(cmd); | ||
| 66 | 65 | ||
| 67 | target_complete_cmd(cmd, GOOD); | 66 | target_complete_cmd(cmd, GOOD); |
| 68 | return 0; | 67 | return 0; |
| @@ -97,11 +96,10 @@ sbc_emulate_readcapacity_16(struct se_cmd *cmd) | |||
| 97 | buf[14] = 0x80; | 96 | buf[14] = 0x80; |
| 98 | 97 | ||
| 99 | rbuf = transport_kmap_data_sg(cmd); | 98 | rbuf = transport_kmap_data_sg(cmd); |
| 100 | if (!rbuf) | 99 | if (rbuf) { |
| 101 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 100 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
| 102 | 101 | transport_kunmap_data_sg(cmd); | |
| 103 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 102 | } |
| 104 | transport_kunmap_data_sg(cmd); | ||
| 105 | 103 | ||
| 106 | target_complete_cmd(cmd, GOOD); | 104 | target_complete_cmd(cmd, GOOD); |
| 107 | return 0; | 105 | return 0; |
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 84f9e96e8ace..2d88f087d961 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
| @@ -641,11 +641,10 @@ spc_emulate_inquiry(struct se_cmd *cmd) | |||
| 641 | 641 | ||
| 642 | out: | 642 | out: |
| 643 | rbuf = transport_kmap_data_sg(cmd); | 643 | rbuf = transport_kmap_data_sg(cmd); |
| 644 | if (!rbuf) | 644 | if (rbuf) { |
| 645 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 645 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
| 646 | 646 | transport_kunmap_data_sg(cmd); | |
| 647 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 647 | } |
| 648 | transport_kunmap_data_sg(cmd); | ||
| 649 | 648 | ||
| 650 | if (!ret) | 649 | if (!ret) |
| 651 | target_complete_cmd(cmd, GOOD); | 650 | target_complete_cmd(cmd, GOOD); |
| @@ -851,7 +850,7 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
| 851 | { | 850 | { |
| 852 | struct se_device *dev = cmd->se_dev; | 851 | struct se_device *dev = cmd->se_dev; |
| 853 | char *cdb = cmd->t_task_cdb; | 852 | char *cdb = cmd->t_task_cdb; |
| 854 | unsigned char *buf, *map_buf; | 853 | unsigned char buf[SE_MODE_PAGE_BUF], *rbuf; |
| 855 | int type = dev->transport->get_device_type(dev); | 854 | int type = dev->transport->get_device_type(dev); |
| 856 | int ten = (cmd->t_task_cdb[0] == MODE_SENSE_10); | 855 | int ten = (cmd->t_task_cdb[0] == MODE_SENSE_10); |
| 857 | bool dbd = !!(cdb[1] & 0x08); | 856 | bool dbd = !!(cdb[1] & 0x08); |
| @@ -863,26 +862,8 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
| 863 | int ret; | 862 | int ret; |
| 864 | int i; | 863 | int i; |
| 865 | 864 | ||
| 866 | map_buf = transport_kmap_data_sg(cmd); | 865 | memset(buf, 0, SE_MODE_PAGE_BUF); |
| 867 | if (!map_buf) | 866 | |
| 868 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
| 869 | /* | ||
| 870 | * If SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC is not set, then we | ||
| 871 | * know we actually allocated a full page. Otherwise, if the | ||
| 872 | * data buffer is too small, allocate a temporary buffer so we | ||
| 873 | * don't have to worry about overruns in all our INQUIRY | ||
| 874 | * emulation handling. | ||
| 875 | */ | ||
| 876 | if (cmd->data_length < SE_MODE_PAGE_BUF && | ||
| 877 | (cmd->se_cmd_flags & SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC)) { | ||
| 878 | buf = kzalloc(SE_MODE_PAGE_BUF, GFP_KERNEL); | ||
| 879 | if (!buf) { | ||
| 880 | transport_kunmap_data_sg(cmd); | ||
| 881 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
| 882 | } | ||
| 883 | } else { | ||
| 884 | buf = map_buf; | ||
| 885 | } | ||
| 886 | /* | 867 | /* |
| 887 | * Skip over MODE DATA LENGTH + MEDIUM TYPE fields to byte 3 for | 868 | * Skip over MODE DATA LENGTH + MEDIUM TYPE fields to byte 3 for |
| 888 | * MODE_SENSE_10 and byte 2 for MODE_SENSE (6). | 869 | * MODE_SENSE_10 and byte 2 for MODE_SENSE (6). |
| @@ -934,8 +915,6 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
| 934 | if (page == 0x3f) { | 915 | if (page == 0x3f) { |
| 935 | if (subpage != 0x00 && subpage != 0xff) { | 916 | if (subpage != 0x00 && subpage != 0xff) { |
| 936 | pr_warn("MODE_SENSE: Invalid subpage code: 0x%02x\n", subpage); | 917 | pr_warn("MODE_SENSE: Invalid subpage code: 0x%02x\n", subpage); |
| 937 | kfree(buf); | ||
| 938 | transport_kunmap_data_sg(cmd); | ||
| 939 | return TCM_INVALID_CDB_FIELD; | 918 | return TCM_INVALID_CDB_FIELD; |
| 940 | } | 919 | } |
| 941 | 920 | ||
| @@ -972,7 +951,6 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
| 972 | pr_err("MODE SENSE: unimplemented page/subpage: 0x%02x/0x%02x\n", | 951 | pr_err("MODE SENSE: unimplemented page/subpage: 0x%02x/0x%02x\n", |
| 973 | page, subpage); | 952 | page, subpage); |
| 974 | 953 | ||
| 975 | transport_kunmap_data_sg(cmd); | ||
| 976 | return TCM_UNKNOWN_MODE_PAGE; | 954 | return TCM_UNKNOWN_MODE_PAGE; |
| 977 | 955 | ||
| 978 | set_length: | 956 | set_length: |
| @@ -981,12 +959,12 @@ set_length: | |||
| 981 | else | 959 | else |
| 982 | buf[0] = length - 1; | 960 | buf[0] = length - 1; |
| 983 | 961 | ||
| 984 | if (buf != map_buf) { | 962 | rbuf = transport_kmap_data_sg(cmd); |
| 985 | memcpy(map_buf, buf, cmd->data_length); | 963 | if (rbuf) { |
| 986 | kfree(buf); | 964 | memcpy(rbuf, buf, min_t(u32, SE_MODE_PAGE_BUF, cmd->data_length)); |
| 965 | transport_kunmap_data_sg(cmd); | ||
| 987 | } | 966 | } |
| 988 | 967 | ||
| 989 | transport_kunmap_data_sg(cmd); | ||
| 990 | target_complete_cmd(cmd, GOOD); | 968 | target_complete_cmd(cmd, GOOD); |
| 991 | return 0; | 969 | return 0; |
| 992 | } | 970 | } |
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index b20df5c829f5..22321cf84fbe 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c | |||
| @@ -575,10 +575,8 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs) | |||
| 575 | 575 | ||
| 576 | /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ | 576 | /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ |
| 577 | tv_tpg = vs->vs_tpg; | 577 | tv_tpg = vs->vs_tpg; |
| 578 | if (unlikely(!tv_tpg)) { | 578 | if (unlikely(!tv_tpg)) |
| 579 | pr_err("%s endpoint not set\n", __func__); | ||
| 580 | return; | 579 | return; |
| 581 | } | ||
| 582 | 580 | ||
| 583 | mutex_lock(&vq->mutex); | 581 | mutex_lock(&vq->mutex); |
| 584 | vhost_disable_notify(&vs->dev, vq); | 582 | vhost_disable_notify(&vs->dev, vq); |
