aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/power/swsusp.txt13
-rw-r--r--MAINTAINERS22
-rw-r--r--arch/tile/lib/memcpy_user_64.c4
-rw-r--r--drivers/acpi/acpi_lpss.c7
-rw-r--r--drivers/acpi/osl.c12
-rw-r--r--drivers/acpi/resource.c162
-rw-r--r--drivers/acpi/scan.c32
-rw-r--r--drivers/ata/Kconfig2
-rw-r--r--drivers/ata/ahci_platform.c9
-rw-r--r--drivers/base/firmware_class.c16
-rw-r--r--drivers/base/power/domain.c13
-rw-r--r--drivers/base/power/wakeirq.c12
-rw-r--r--drivers/base/power/wakeup.c31
-rw-r--r--drivers/pnp/system.c35
-rw-r--r--fs/compat_ioctl.c1
-rw-r--r--fs/ecryptfs/file.c1
-rw-r--r--fs/ext4/ioctl.c1
-rw-r--r--fs/hpfs/alloc.c95
-rw-r--r--fs/hpfs/dir.c1
-rw-r--r--fs/hpfs/file.c1
-rw-r--r--fs/hpfs/hpfs_fn.h4
-rw-r--r--fs/hpfs/super.c47
-rw-r--r--fs/jfs/ioctl.c3
-rw-r--r--fs/nilfs2/ioctl.c1
-rw-r--r--fs/ocfs2/ioctl.c1
-rw-r--r--include/linux/acpi.h24
-rw-r--r--include/linux/ceph/messenger.h3
-rw-r--r--include/linux/mod_devicetable.h2
-rw-r--r--kernel/auditsc.c3
-rw-r--r--kernel/module.c1
-rw-r--r--mm/memory.c20
-rw-r--r--net/ceph/ceph_common.c16
-rw-r--r--net/ceph/messenger.c24
-rw-r--r--scripts/mod/devicetable-offsets.c2
-rw-r--r--scripts/mod/file2alias.c32
-rw-r--r--scripts/mod/modpost.c3
36 files changed, 369 insertions, 287 deletions
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index f732a8321e8a..8cc17ca71813 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -410,8 +410,17 @@ Documentation/usb/persist.txt.
410 410
411Q: Can I suspend-to-disk using a swap partition under LVM? 411Q: Can I suspend-to-disk using a swap partition under LVM?
412 412
413A: No. You can suspend successfully, but you'll not be able to 413A: Yes and No. You can suspend successfully, but the kernel will not be able
414resume. uswsusp should be able to work with LVM. See suspend.sf.net. 414to resume on its own. You need an initramfs that can recognize the resume
415situation, activate the logical volume containing the swap volume (but not
416touch any filesystems!), and eventually call
417
418echo -n "$major:$minor" > /sys/power/resume
419
420where $major and $minor are the respective major and minor device numbers of
421the swap volume.
422
423uswsusp works with LVM, too. See http://suspend.sourceforge.net/
415 424
416Q: I upgraded the kernel from 2.6.15 to 2.6.16. Both kernels were 425Q: I upgraded the kernel from 2.6.15 to 2.6.16. Both kernels were
417compiled with the similar configuration files. Anyway I found that 426compiled with the similar configuration files. Anyway I found that
diff --git a/MAINTAINERS b/MAINTAINERS
index 8133cefb6b6e..0d70760e8135 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2562,19 +2562,31 @@ F: arch/powerpc/include/uapi/asm/spu*.h
2562F: arch/powerpc/oprofile/*cell* 2562F: arch/powerpc/oprofile/*cell*
2563F: arch/powerpc/platforms/cell/ 2563F: arch/powerpc/platforms/cell/
2564 2564
2565CEPH DISTRIBUTED FILE SYSTEM CLIENT 2565CEPH COMMON CODE (LIBCEPH)
2566M: Ilya Dryomov <idryomov@gmail.com>
2566M: "Yan, Zheng" <zyan@redhat.com> 2567M: "Yan, Zheng" <zyan@redhat.com>
2567M: Sage Weil <sage@redhat.com> 2568M: Sage Weil <sage@redhat.com>
2568L: ceph-devel@vger.kernel.org 2569L: ceph-devel@vger.kernel.org
2569W: http://ceph.com/ 2570W: http://ceph.com/
2570T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git 2571T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
2572T: git git://github.com/ceph/ceph-client.git
2571S: Supported 2573S: Supported
2572F: Documentation/filesystems/ceph.txt
2573F: fs/ceph/
2574F: net/ceph/ 2574F: net/ceph/
2575F: include/linux/ceph/ 2575F: include/linux/ceph/
2576F: include/linux/crush/ 2576F: include/linux/crush/
2577 2577
2578CEPH DISTRIBUTED FILE SYSTEM CLIENT (CEPH)
2579M: "Yan, Zheng" <zyan@redhat.com>
2580M: Sage Weil <sage@redhat.com>
2581M: Ilya Dryomov <idryomov@gmail.com>
2582L: ceph-devel@vger.kernel.org
2583W: http://ceph.com/
2584T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
2585T: git git://github.com/ceph/ceph-client.git
2586S: Supported
2587F: Documentation/filesystems/ceph.txt
2588F: fs/ceph/
2589
2578CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM: 2590CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
2579L: linux-usb@vger.kernel.org 2591L: linux-usb@vger.kernel.org
2580S: Orphan 2592S: Orphan
@@ -8366,10 +8378,12 @@ RADOS BLOCK DEVICE (RBD)
8366M: Ilya Dryomov <idryomov@gmail.com> 8378M: Ilya Dryomov <idryomov@gmail.com>
8367M: Sage Weil <sage@redhat.com> 8379M: Sage Weil <sage@redhat.com>
8368M: Alex Elder <elder@kernel.org> 8380M: Alex Elder <elder@kernel.org>
8369M: ceph-devel@vger.kernel.org 8381L: ceph-devel@vger.kernel.org
8370W: http://ceph.com/ 8382W: http://ceph.com/
8371T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git 8383T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
8384T: git git://github.com/ceph/ceph-client.git
8372S: Supported 8385S: Supported
8386F: Documentation/ABI/testing/sysfs-bus-rbd
8373F: drivers/block/rbd.c 8387F: drivers/block/rbd.c
8374F: drivers/block/rbd_types.h 8388F: drivers/block/rbd_types.h
8375 8389
diff --git a/arch/tile/lib/memcpy_user_64.c b/arch/tile/lib/memcpy_user_64.c
index 88c7016492c4..97bbb6060b25 100644
--- a/arch/tile/lib/memcpy_user_64.c
+++ b/arch/tile/lib/memcpy_user_64.c
@@ -28,7 +28,7 @@
28#define _ST(p, inst, v) \ 28#define _ST(p, inst, v) \
29 ({ \ 29 ({ \
30 asm("1: " #inst " %0, %1;" \ 30 asm("1: " #inst " %0, %1;" \
31 ".pushsection .coldtext.memcpy,\"ax\";" \ 31 ".pushsection .coldtext,\"ax\";" \
32 "2: { move r0, %2; jrp lr };" \ 32 "2: { move r0, %2; jrp lr };" \
33 ".section __ex_table,\"a\";" \ 33 ".section __ex_table,\"a\";" \
34 ".align 8;" \ 34 ".align 8;" \
@@ -41,7 +41,7 @@
41 ({ \ 41 ({ \
42 unsigned long __v; \ 42 unsigned long __v; \
43 asm("1: " #inst " %0, %1;" \ 43 asm("1: " #inst " %0, %1;" \
44 ".pushsection .coldtext.memcpy,\"ax\";" \ 44 ".pushsection .coldtext,\"ax\";" \
45 "2: { move r0, %2; jrp lr };" \ 45 "2: { move r0, %2; jrp lr };" \
46 ".section __ex_table,\"a\";" \ 46 ".section __ex_table,\"a\";" \
47 ".align 8;" \ 47 ".align 8;" \
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 569ee090343f..46b58abb08c5 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -352,13 +352,16 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
352 pdata->mmio_size = resource_size(rentry->res); 352 pdata->mmio_size = resource_size(rentry->res);
353 pdata->mmio_base = ioremap(rentry->res->start, 353 pdata->mmio_base = ioremap(rentry->res->start,
354 pdata->mmio_size); 354 pdata->mmio_size);
355 if (!pdata->mmio_base)
356 goto err_out;
357 break; 355 break;
358 } 356 }
359 357
360 acpi_dev_free_resource_list(&resource_list); 358 acpi_dev_free_resource_list(&resource_list);
361 359
360 if (!pdata->mmio_base) {
361 ret = -ENOMEM;
362 goto err_out;
363 }
364
362 pdata->dev_desc = dev_desc; 365 pdata->dev_desc = dev_desc;
363 366
364 if (dev_desc->setup) 367 if (dev_desc->setup)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index c262e4acd68d..3b8963f21b36 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -175,10 +175,14 @@ static void __init acpi_request_region (struct acpi_generic_address *gas,
175 if (!addr || !length) 175 if (!addr || !length)
176 return; 176 return;
177 177
178 acpi_reserve_region(addr, length, gas->space_id, 0, desc); 178 /* Resources are never freed */
179 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
180 request_region(addr, length, desc);
181 else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
182 request_mem_region(addr, length, desc);
179} 183}
180 184
181static void __init acpi_reserve_resources(void) 185static int __init acpi_reserve_resources(void)
182{ 186{
183 acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length, 187 acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length,
184 "ACPI PM1a_EVT_BLK"); 188 "ACPI PM1a_EVT_BLK");
@@ -207,7 +211,10 @@ static void __init acpi_reserve_resources(void)
207 if (!(acpi_gbl_FADT.gpe1_block_length & 0x1)) 211 if (!(acpi_gbl_FADT.gpe1_block_length & 0x1))
208 acpi_request_region(&acpi_gbl_FADT.xgpe1_block, 212 acpi_request_region(&acpi_gbl_FADT.xgpe1_block,
209 acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK"); 213 acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK");
214
215 return 0;
210} 216}
217fs_initcall_sync(acpi_reserve_resources);
211 218
212void acpi_os_printf(const char *fmt, ...) 219void acpi_os_printf(const char *fmt, ...)
213{ 220{
@@ -1862,7 +1869,6 @@ acpi_status __init acpi_os_initialize(void)
1862 1869
1863acpi_status __init acpi_os_initialize1(void) 1870acpi_status __init acpi_os_initialize1(void)
1864{ 1871{
1865 acpi_reserve_resources();
1866 kacpid_wq = alloc_workqueue("kacpid", 0, 1); 1872 kacpid_wq = alloc_workqueue("kacpid", 0, 1);
1867 kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1); 1873 kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1);
1868 kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0); 1874 kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0);
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 10561ce16ed1..8244f013f210 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -26,7 +26,6 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/export.h> 27#include <linux/export.h>
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/list.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31 30
32#ifdef CONFIG_X86 31#ifdef CONFIG_X86
@@ -622,164 +621,3 @@ int acpi_dev_filter_resource_type(struct acpi_resource *ares,
622 return (type & types) ? 0 : 1; 621 return (type & types) ? 0 : 1;
623} 622}
624EXPORT_SYMBOL_GPL(acpi_dev_filter_resource_type); 623EXPORT_SYMBOL_GPL(acpi_dev_filter_resource_type);
625
626struct reserved_region {
627 struct list_head node;
628 u64 start;
629 u64 end;
630};
631
632static LIST_HEAD(reserved_io_regions);
633static LIST_HEAD(reserved_mem_regions);
634
635static int request_range(u64 start, u64 end, u8 space_id, unsigned long flags,
636 char *desc)
637{
638 unsigned int length = end - start + 1;
639 struct resource *res;
640
641 res = space_id == ACPI_ADR_SPACE_SYSTEM_IO ?
642 request_region(start, length, desc) :
643 request_mem_region(start, length, desc);
644 if (!res)
645 return -EIO;
646
647 res->flags &= ~flags;
648 return 0;
649}
650
651static int add_region_before(u64 start, u64 end, u8 space_id,
652 unsigned long flags, char *desc,
653 struct list_head *head)
654{
655 struct reserved_region *reg;
656 int error;
657
658 reg = kmalloc(sizeof(*reg), GFP_KERNEL);
659 if (!reg)
660 return -ENOMEM;
661
662 error = request_range(start, end, space_id, flags, desc);
663 if (error) {
664 kfree(reg);
665 return error;
666 }
667
668 reg->start = start;
669 reg->end = end;
670 list_add_tail(&reg->node, head);
671 return 0;
672}
673
674/**
675 * acpi_reserve_region - Reserve an I/O or memory region as a system resource.
676 * @start: Starting address of the region.
677 * @length: Length of the region.
678 * @space_id: Identifier of address space to reserve the region from.
679 * @flags: Resource flags to clear for the region after requesting it.
680 * @desc: Region description (for messages).
681 *
682 * Reserve an I/O or memory region as a system resource to prevent others from
683 * using it. If the new region overlaps with one of the regions (in the given
684 * address space) already reserved by this routine, only the non-overlapping
685 * parts of it will be reserved.
686 *
687 * Returned is either 0 (success) or a negative error code indicating a resource
688 * reservation problem. It is the code of the first encountered error, but the
689 * routine doesn't abort until it has attempted to request all of the parts of
690 * the new region that don't overlap with other regions reserved previously.
691 *
692 * The resources requested by this routine are never released.
693 */
694int acpi_reserve_region(u64 start, unsigned int length, u8 space_id,
695 unsigned long flags, char *desc)
696{
697 struct list_head *regions;
698 struct reserved_region *reg;
699 u64 end = start + length - 1;
700 int ret = 0, error = 0;
701
702 if (space_id == ACPI_ADR_SPACE_SYSTEM_IO)
703 regions = &reserved_io_regions;
704 else if (space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
705 regions = &reserved_mem_regions;
706 else
707 return -EINVAL;
708
709 if (list_empty(regions))
710 return add_region_before(start, end, space_id, flags, desc, regions);
711
712 list_for_each_entry(reg, regions, node)
713 if (reg->start == end + 1) {
714 /* The new region can be prepended to this one. */
715 ret = request_range(start, end, space_id, flags, desc);
716 if (!ret)
717 reg->start = start;
718
719 return ret;
720 } else if (reg->start > end) {
721 /* No overlap. Add the new region here and get out. */
722 return add_region_before(start, end, space_id, flags,
723 desc, &reg->node);
724 } else if (reg->end == start - 1) {
725 goto combine;
726 } else if (reg->end >= start) {
727 goto overlap;
728 }
729
730 /* The new region goes after the last existing one. */
731 return add_region_before(start, end, space_id, flags, desc, regions);
732
733 overlap:
734 /*
735 * The new region overlaps an existing one.
736 *
737 * The head part of the new region immediately preceding the existing
738 * overlapping one can be combined with it right away.
739 */
740 if (reg->start > start) {
741 error = request_range(start, reg->start - 1, space_id, flags, desc);
742 if (error)
743 ret = error;
744 else
745 reg->start = start;
746 }
747
748 combine:
749 /*
750 * The new region is adjacent to an existing one. If it extends beyond
751 * that region all the way to the next one, it is possible to combine
752 * all three of them.
753 */
754 while (reg->end < end) {
755 struct reserved_region *next = NULL;
756 u64 a = reg->end + 1, b = end;
757
758 if (!list_is_last(&reg->node, regions)) {
759 next = list_next_entry(reg, node);
760 if (next->start <= end)
761 b = next->start - 1;
762 }
763 error = request_range(a, b, space_id, flags, desc);
764 if (!error) {
765 if (next && next->start == b + 1) {
766 reg->end = next->end;
767 list_del(&next->node);
768 kfree(next);
769 } else {
770 reg->end = end;
771 break;
772 }
773 } else if (next) {
774 if (!ret)
775 ret = error;
776
777 reg = next;
778 } else {
779 break;
780 }
781 }
782
783 return ret ? ret : error;
784}
785EXPORT_SYMBOL_GPL(acpi_reserve_region);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 2649a068671d..ec256352f423 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1019,6 +1019,29 @@ static bool acpi_of_match_device(struct acpi_device *adev,
1019 return false; 1019 return false;
1020} 1020}
1021 1021
1022static bool __acpi_match_device_cls(const struct acpi_device_id *id,
1023 struct acpi_hardware_id *hwid)
1024{
1025 int i, msk, byte_shift;
1026 char buf[3];
1027
1028 if (!id->cls)
1029 return false;
1030
1031 /* Apply class-code bitmask, before checking each class-code byte */
1032 for (i = 1; i <= 3; i++) {
1033 byte_shift = 8 * (3 - i);
1034 msk = (id->cls_msk >> byte_shift) & 0xFF;
1035 if (!msk)
1036 continue;
1037
1038 sprintf(buf, "%02x", (id->cls >> byte_shift) & msk);
1039 if (strncmp(buf, &hwid->id[(i - 1) * 2], 2))
1040 return false;
1041 }
1042 return true;
1043}
1044
1022static const struct acpi_device_id *__acpi_match_device( 1045static const struct acpi_device_id *__acpi_match_device(
1023 struct acpi_device *device, 1046 struct acpi_device *device,
1024 const struct acpi_device_id *ids, 1047 const struct acpi_device_id *ids,
@@ -1036,9 +1059,12 @@ static const struct acpi_device_id *__acpi_match_device(
1036 1059
1037 list_for_each_entry(hwid, &device->pnp.ids, list) { 1060 list_for_each_entry(hwid, &device->pnp.ids, list) {
1038 /* First, check the ACPI/PNP IDs provided by the caller. */ 1061 /* First, check the ACPI/PNP IDs provided by the caller. */
1039 for (id = ids; id->id[0]; id++) 1062 for (id = ids; id->id[0] || id->cls; id++) {
1040 if (!strcmp((char *) id->id, hwid->id)) 1063 if (id->id[0] && !strcmp((char *) id->id, hwid->id))
1041 return id; 1064 return id;
1065 else if (id->cls && __acpi_match_device_cls(id, hwid))
1066 return id;
1067 }
1042 1068
1043 /* 1069 /*
1044 * Next, check ACPI_DT_NAMESPACE_HID and try to match the 1070 * Next, check ACPI_DT_NAMESPACE_HID and try to match the
@@ -2101,6 +2127,8 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,
2101 if (info->valid & ACPI_VALID_UID) 2127 if (info->valid & ACPI_VALID_UID)
2102 pnp->unique_id = kstrdup(info->unique_id.string, 2128 pnp->unique_id = kstrdup(info->unique_id.string,
2103 GFP_KERNEL); 2129 GFP_KERNEL);
2130 if (info->valid & ACPI_VALID_CLS)
2131 acpi_add_id(pnp, info->class_code.string);
2104 2132
2105 kfree(info); 2133 kfree(info);
2106 2134
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 6d17a3b65ef7..15e40ee62a94 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -48,7 +48,7 @@ config ATA_VERBOSE_ERROR
48 48
49config ATA_ACPI 49config ATA_ACPI
50 bool "ATA ACPI Support" 50 bool "ATA ACPI Support"
51 depends on ACPI && PCI 51 depends on ACPI
52 default y 52 default y
53 help 53 help
54 This option adds support for ATA-related ACPI objects. 54 This option adds support for ATA-related ACPI objects.
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 614c78f510f0..1befb114c384 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -20,6 +20,8 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/libata.h> 21#include <linux/libata.h>
22#include <linux/ahci_platform.h> 22#include <linux/ahci_platform.h>
23#include <linux/acpi.h>
24#include <linux/pci_ids.h>
23#include "ahci.h" 25#include "ahci.h"
24 26
25#define DRV_NAME "ahci" 27#define DRV_NAME "ahci"
@@ -79,12 +81,19 @@ static const struct of_device_id ahci_of_match[] = {
79}; 81};
80MODULE_DEVICE_TABLE(of, ahci_of_match); 82MODULE_DEVICE_TABLE(of, ahci_of_match);
81 83
84static const struct acpi_device_id ahci_acpi_match[] = {
85 { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
86 {},
87};
88MODULE_DEVICE_TABLE(acpi, ahci_acpi_match);
89
82static struct platform_driver ahci_driver = { 90static struct platform_driver ahci_driver = {
83 .probe = ahci_probe, 91 .probe = ahci_probe,
84 .remove = ata_platform_remove_one, 92 .remove = ata_platform_remove_one,
85 .driver = { 93 .driver = {
86 .name = DRV_NAME, 94 .name = DRV_NAME,
87 .of_match_table = ahci_of_match, 95 .of_match_table = ahci_of_match,
96 .acpi_match_table = ahci_acpi_match,
88 .pm = &ahci_pm_ops, 97 .pm = &ahci_pm_ops,
89 }, 98 },
90}; 99};
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 9c4288362a8e..894bda114224 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -563,10 +563,8 @@ static void fw_dev_release(struct device *dev)
563 kfree(fw_priv); 563 kfree(fw_priv);
564} 564}
565 565
566static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) 566static int do_firmware_uevent(struct firmware_priv *fw_priv, struct kobj_uevent_env *env)
567{ 567{
568 struct firmware_priv *fw_priv = to_firmware_priv(dev);
569
570 if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id)) 568 if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id))
571 return -ENOMEM; 569 return -ENOMEM;
572 if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout)) 570 if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout))
@@ -577,6 +575,18 @@ static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
577 return 0; 575 return 0;
578} 576}
579 577
578static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
579{
580 struct firmware_priv *fw_priv = to_firmware_priv(dev);
581 int err = 0;
582
583 mutex_lock(&fw_lock);
584 if (fw_priv->buf)
585 err = do_firmware_uevent(fw_priv, env);
586 mutex_unlock(&fw_lock);
587 return err;
588}
589
580static struct class firmware_class = { 590static struct class firmware_class = {
581 .name = "firmware", 591 .name = "firmware",
582 .class_attrs = firmware_class_attrs, 592 .class_attrs = firmware_class_attrs,
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index cdd547bd67df..0ee43c1056e0 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -6,6 +6,7 @@
6 * This file is released under the GPLv2. 6 * This file is released under the GPLv2.
7 */ 7 */
8 8
9#include <linux/delay.h>
9#include <linux/kernel.h> 10#include <linux/kernel.h>
10#include <linux/io.h> 11#include <linux/io.h>
11#include <linux/platform_device.h> 12#include <linux/platform_device.h>
@@ -19,6 +20,8 @@
19#include <linux/suspend.h> 20#include <linux/suspend.h>
20#include <linux/export.h> 21#include <linux/export.h>
21 22
23#define GENPD_RETRY_MAX_MS 250 /* Approximate */
24
22#define GENPD_DEV_CALLBACK(genpd, type, callback, dev) \ 25#define GENPD_DEV_CALLBACK(genpd, type, callback, dev) \
23({ \ 26({ \
24 type (*__routine)(struct device *__d); \ 27 type (*__routine)(struct device *__d); \
@@ -2131,6 +2134,7 @@ EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);
2131static void genpd_dev_pm_detach(struct device *dev, bool power_off) 2134static void genpd_dev_pm_detach(struct device *dev, bool power_off)
2132{ 2135{
2133 struct generic_pm_domain *pd; 2136 struct generic_pm_domain *pd;
2137 unsigned int i;
2134 int ret = 0; 2138 int ret = 0;
2135 2139
2136 pd = pm_genpd_lookup_dev(dev); 2140 pd = pm_genpd_lookup_dev(dev);
@@ -2139,10 +2143,12 @@ static void genpd_dev_pm_detach(struct device *dev, bool power_off)
2139 2143
2140 dev_dbg(dev, "removing from PM domain %s\n", pd->name); 2144 dev_dbg(dev, "removing from PM domain %s\n", pd->name);
2141 2145
2142 while (1) { 2146 for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) {
2143 ret = pm_genpd_remove_device(pd, dev); 2147 ret = pm_genpd_remove_device(pd, dev);
2144 if (ret != -EAGAIN) 2148 if (ret != -EAGAIN)
2145 break; 2149 break;
2150
2151 mdelay(i);
2146 cond_resched(); 2152 cond_resched();
2147 } 2153 }
2148 2154
@@ -2183,6 +2189,7 @@ int genpd_dev_pm_attach(struct device *dev)
2183{ 2189{
2184 struct of_phandle_args pd_args; 2190 struct of_phandle_args pd_args;
2185 struct generic_pm_domain *pd; 2191 struct generic_pm_domain *pd;
2192 unsigned int i;
2186 int ret; 2193 int ret;
2187 2194
2188 if (!dev->of_node) 2195 if (!dev->of_node)
@@ -2218,10 +2225,12 @@ int genpd_dev_pm_attach(struct device *dev)
2218 2225
2219 dev_dbg(dev, "adding to PM domain %s\n", pd->name); 2226 dev_dbg(dev, "adding to PM domain %s\n", pd->name);
2220 2227
2221 while (1) { 2228 for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) {
2222 ret = pm_genpd_add_device(pd, dev); 2229 ret = pm_genpd_add_device(pd, dev);
2223 if (ret != -EAGAIN) 2230 if (ret != -EAGAIN)
2224 break; 2231 break;
2232
2233 mdelay(i);
2225 cond_resched(); 2234 cond_resched();
2226 } 2235 }
2227 2236
diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index 7470004ca810..eb6e67451dec 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -45,14 +45,12 @@ static int dev_pm_attach_wake_irq(struct device *dev, int irq,
45 return -EEXIST; 45 return -EEXIST;
46 } 46 }
47 47
48 dev->power.wakeirq = wirq;
49 spin_unlock_irqrestore(&dev->power.lock, flags);
50
51 err = device_wakeup_attach_irq(dev, wirq); 48 err = device_wakeup_attach_irq(dev, wirq);
52 if (err) 49 if (!err)
53 return err; 50 dev->power.wakeirq = wirq;
54 51
55 return 0; 52 spin_unlock_irqrestore(&dev->power.lock, flags);
53 return err;
56} 54}
57 55
58/** 56/**
@@ -105,10 +103,10 @@ void dev_pm_clear_wake_irq(struct device *dev)
105 return; 103 return;
106 104
107 spin_lock_irqsave(&dev->power.lock, flags); 105 spin_lock_irqsave(&dev->power.lock, flags);
106 device_wakeup_detach_irq(dev);
108 dev->power.wakeirq = NULL; 107 dev->power.wakeirq = NULL;
109 spin_unlock_irqrestore(&dev->power.lock, flags); 108 spin_unlock_irqrestore(&dev->power.lock, flags);
110 109
111 device_wakeup_detach_irq(dev);
112 if (wirq->dedicated_irq) 110 if (wirq->dedicated_irq)
113 free_irq(wirq->irq, wirq); 111 free_irq(wirq->irq, wirq);
114 kfree(wirq); 112 kfree(wirq);
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 40f71603378c..51f15bc15774 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -281,32 +281,25 @@ EXPORT_SYMBOL_GPL(device_wakeup_enable);
281 * Attach a device wakeirq to the wakeup source so the device 281 * Attach a device wakeirq to the wakeup source so the device
282 * wake IRQ can be configured automatically for suspend and 282 * wake IRQ can be configured automatically for suspend and
283 * resume. 283 * resume.
284 *
285 * Call under the device's power.lock lock.
284 */ 286 */
285int device_wakeup_attach_irq(struct device *dev, 287int device_wakeup_attach_irq(struct device *dev,
286 struct wake_irq *wakeirq) 288 struct wake_irq *wakeirq)
287{ 289{
288 struct wakeup_source *ws; 290 struct wakeup_source *ws;
289 int ret = 0;
290 291
291 spin_lock_irq(&dev->power.lock);
292 ws = dev->power.wakeup; 292 ws = dev->power.wakeup;
293 if (!ws) { 293 if (!ws) {
294 dev_err(dev, "forgot to call call device_init_wakeup?\n"); 294 dev_err(dev, "forgot to call call device_init_wakeup?\n");
295 ret = -EINVAL; 295 return -EINVAL;
296 goto unlock;
297 } 296 }
298 297
299 if (ws->wakeirq) { 298 if (ws->wakeirq)
300 ret = -EEXIST; 299 return -EEXIST;
301 goto unlock;
302 }
303 300
304 ws->wakeirq = wakeirq; 301 ws->wakeirq = wakeirq;
305 302 return 0;
306unlock:
307 spin_unlock_irq(&dev->power.lock);
308
309 return ret;
310} 303}
311 304
312/** 305/**
@@ -314,20 +307,16 @@ unlock:
314 * @dev: Device to handle 307 * @dev: Device to handle
315 * 308 *
316 * Removes a device wakeirq from the wakeup source. 309 * Removes a device wakeirq from the wakeup source.
310 *
311 * Call under the device's power.lock lock.
317 */ 312 */
318void device_wakeup_detach_irq(struct device *dev) 313void device_wakeup_detach_irq(struct device *dev)
319{ 314{
320 struct wakeup_source *ws; 315 struct wakeup_source *ws;
321 316
322 spin_lock_irq(&dev->power.lock);
323 ws = dev->power.wakeup; 317 ws = dev->power.wakeup;
324 if (!ws) 318 if (ws)
325 goto unlock; 319 ws->wakeirq = NULL;
326
327 ws->wakeirq = NULL;
328
329unlock:
330 spin_unlock_irq(&dev->power.lock);
331} 320}
332 321
333/** 322/**
diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
index 515f33882ab8..49c1720df59a 100644
--- a/drivers/pnp/system.c
+++ b/drivers/pnp/system.c
@@ -7,7 +7,6 @@
7 * Bjorn Helgaas <bjorn.helgaas@hp.com> 7 * Bjorn Helgaas <bjorn.helgaas@hp.com>
8 */ 8 */
9 9
10#include <linux/acpi.h>
11#include <linux/pnp.h> 10#include <linux/pnp.h>
12#include <linux/device.h> 11#include <linux/device.h>
13#include <linux/init.h> 12#include <linux/init.h>
@@ -23,41 +22,25 @@ static const struct pnp_device_id pnp_dev_table[] = {
23 {"", 0} 22 {"", 0}
24}; 23};
25 24
26#ifdef CONFIG_ACPI
27static bool __reserve_range(u64 start, unsigned int length, bool io, char *desc)
28{
29 u8 space_id = io ? ACPI_ADR_SPACE_SYSTEM_IO : ACPI_ADR_SPACE_SYSTEM_MEMORY;
30 return !acpi_reserve_region(start, length, space_id, IORESOURCE_BUSY, desc);
31}
32#else
33static bool __reserve_range(u64 start, unsigned int length, bool io, char *desc)
34{
35 struct resource *res;
36
37 res = io ? request_region(start, length, desc) :
38 request_mem_region(start, length, desc);
39 if (res) {
40 res->flags &= ~IORESOURCE_BUSY;
41 return true;
42 }
43 return false;
44}
45#endif
46
47static void reserve_range(struct pnp_dev *dev, struct resource *r, int port) 25static void reserve_range(struct pnp_dev *dev, struct resource *r, int port)
48{ 26{
49 char *regionid; 27 char *regionid;
50 const char *pnpid = dev_name(&dev->dev); 28 const char *pnpid = dev_name(&dev->dev);
51 resource_size_t start = r->start, end = r->end; 29 resource_size_t start = r->start, end = r->end;
52 bool reserved; 30 struct resource *res;
53 31
54 regionid = kmalloc(16, GFP_KERNEL); 32 regionid = kmalloc(16, GFP_KERNEL);
55 if (!regionid) 33 if (!regionid)
56 return; 34 return;
57 35
58 snprintf(regionid, 16, "pnp %s", pnpid); 36 snprintf(regionid, 16, "pnp %s", pnpid);
59 reserved = __reserve_range(start, end - start + 1, !!port, regionid); 37 if (port)
60 if (!reserved) 38 res = request_region(start, end - start + 1, regionid);
39 else
40 res = request_mem_region(start, end - start + 1, regionid);
41 if (res)
42 res->flags &= ~IORESOURCE_BUSY;
43 else
61 kfree(regionid); 44 kfree(regionid);
62 45
63 /* 46 /*
@@ -66,7 +49,7 @@ static void reserve_range(struct pnp_dev *dev, struct resource *r, int port)
66 * have double reservations. 49 * have double reservations.
67 */ 50 */
68 dev_info(&dev->dev, "%pR %s reserved\n", r, 51 dev_info(&dev->dev, "%pR %s reserved\n", r,
69 reserved ? "has been" : "could not be"); 52 res ? "has been" : "could not be");
70} 53}
71 54
72static void reserve_resources_of_dev(struct pnp_dev *dev) 55static void reserve_resources_of_dev(struct pnp_dev *dev)
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 6b8e2f091f5b..48851f6ea6ec 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -896,6 +896,7 @@ COMPATIBLE_IOCTL(FIGETBSZ)
896/* 'X' - originally XFS but some now in the VFS */ 896/* 'X' - originally XFS but some now in the VFS */
897COMPATIBLE_IOCTL(FIFREEZE) 897COMPATIBLE_IOCTL(FIFREEZE)
898COMPATIBLE_IOCTL(FITHAW) 898COMPATIBLE_IOCTL(FITHAW)
899COMPATIBLE_IOCTL(FITRIM)
899COMPATIBLE_IOCTL(KDGETKEYCODE) 900COMPATIBLE_IOCTL(KDGETKEYCODE)
900COMPATIBLE_IOCTL(KDSETKEYCODE) 901COMPATIBLE_IOCTL(KDSETKEYCODE)
901COMPATIBLE_IOCTL(KDGKBTYPE) 902COMPATIBLE_IOCTL(KDGKBTYPE)
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 72afcc629d7b..feef8a9c4de7 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -325,7 +325,6 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
325 return rc; 325 return rc;
326 326
327 switch (cmd) { 327 switch (cmd) {
328 case FITRIM:
329 case FS_IOC32_GETFLAGS: 328 case FS_IOC32_GETFLAGS:
330 case FS_IOC32_SETFLAGS: 329 case FS_IOC32_SETFLAGS:
331 case FS_IOC32_GETVERSION: 330 case FS_IOC32_GETVERSION:
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index cb8451246b30..1346cfa355d0 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -755,7 +755,6 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
755 return err; 755 return err;
756 } 756 }
757 case EXT4_IOC_MOVE_EXT: 757 case EXT4_IOC_MOVE_EXT:
758 case FITRIM:
759 case EXT4_IOC_RESIZE_FS: 758 case EXT4_IOC_RESIZE_FS:
760 case EXT4_IOC_PRECACHE_EXTENTS: 759 case EXT4_IOC_PRECACHE_EXTENTS:
761 case EXT4_IOC_SET_ENCRYPTION_POLICY: 760 case EXT4_IOC_SET_ENCRYPTION_POLICY:
diff --git a/fs/hpfs/alloc.c b/fs/hpfs/alloc.c
index f005046e1591..d6a4b55d2ab0 100644
--- a/fs/hpfs/alloc.c
+++ b/fs/hpfs/alloc.c
@@ -484,3 +484,98 @@ struct anode *hpfs_alloc_anode(struct super_block *s, secno near, anode_secno *a
484 a->btree.first_free = cpu_to_le16(8); 484 a->btree.first_free = cpu_to_le16(8);
485 return a; 485 return a;
486} 486}
487
488static unsigned find_run(__le32 *bmp, unsigned *idx)
489{
490 unsigned len;
491 while (tstbits(bmp, *idx, 1)) {
492 (*idx)++;
493 if (unlikely(*idx >= 0x4000))
494 return 0;
495 }
496 len = 1;
497 while (!tstbits(bmp, *idx + len, 1))
498 len++;
499 return len;
500}
501
502static int do_trim(struct super_block *s, secno start, unsigned len, secno limit_start, secno limit_end, unsigned minlen, unsigned *result)
503{
504 int err;
505 secno end;
506 if (fatal_signal_pending(current))
507 return -EINTR;
508 end = start + len;
509 if (start < limit_start)
510 start = limit_start;
511 if (end > limit_end)
512 end = limit_end;
513 if (start >= end)
514 return 0;
515 if (end - start < minlen)
516 return 0;
517 err = sb_issue_discard(s, start, end - start, GFP_NOFS, 0);
518 if (err)
519 return err;
520 *result += end - start;
521 return 0;
522}
523
524int hpfs_trim_fs(struct super_block *s, u64 start, u64 end, u64 minlen, unsigned *result)
525{
526 int err = 0;
527 struct hpfs_sb_info *sbi = hpfs_sb(s);
528 unsigned idx, len, start_bmp, end_bmp;
529 __le32 *bmp;
530 struct quad_buffer_head qbh;
531
532 *result = 0;
533 if (!end || end > sbi->sb_fs_size)
534 end = sbi->sb_fs_size;
535 if (start >= sbi->sb_fs_size)
536 return 0;
537 if (minlen > 0x4000)
538 return 0;
539 if (start < sbi->sb_dirband_start + sbi->sb_dirband_size && end > sbi->sb_dirband_start) {
540 hpfs_lock(s);
541 if (s->s_flags & MS_RDONLY) {
542 err = -EROFS;
543 goto unlock_1;
544 }
545 if (!(bmp = hpfs_map_dnode_bitmap(s, &qbh))) {
546 err = -EIO;
547 goto unlock_1;
548 }
549 idx = 0;
550 while ((len = find_run(bmp, &idx)) && !err) {
551 err = do_trim(s, sbi->sb_dirband_start + idx * 4, len * 4, start, end, minlen, result);
552 idx += len;
553 }
554 hpfs_brelse4(&qbh);
555unlock_1:
556 hpfs_unlock(s);
557 }
558 start_bmp = start >> 14;
559 end_bmp = (end + 0x3fff) >> 14;
560 while (start_bmp < end_bmp && !err) {
561 hpfs_lock(s);
562 if (s->s_flags & MS_RDONLY) {
563 err = -EROFS;
564 goto unlock_2;
565 }
566 if (!(bmp = hpfs_map_bitmap(s, start_bmp, &qbh, "trim"))) {
567 err = -EIO;
568 goto unlock_2;
569 }
570 idx = 0;
571 while ((len = find_run(bmp, &idx)) && !err) {
572 err = do_trim(s, (start_bmp << 14) + idx, len, start, end, minlen, result);
573 idx += len;
574 }
575 hpfs_brelse4(&qbh);
576unlock_2:
577 hpfs_unlock(s);
578 start_bmp++;
579 }
580 return err;
581}
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c
index 2a8e07425de0..dc540bfcee1d 100644
--- a/fs/hpfs/dir.c
+++ b/fs/hpfs/dir.c
@@ -327,4 +327,5 @@ const struct file_operations hpfs_dir_ops =
327 .iterate = hpfs_readdir, 327 .iterate = hpfs_readdir,
328 .release = hpfs_dir_release, 328 .release = hpfs_dir_release,
329 .fsync = hpfs_file_fsync, 329 .fsync = hpfs_file_fsync,
330 .unlocked_ioctl = hpfs_ioctl,
330}; 331};
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index 6d8cfe9b52d6..7ca28d604bf7 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -203,6 +203,7 @@ const struct file_operations hpfs_file_ops =
203 .release = hpfs_file_release, 203 .release = hpfs_file_release,
204 .fsync = hpfs_file_fsync, 204 .fsync = hpfs_file_fsync,
205 .splice_read = generic_file_splice_read, 205 .splice_read = generic_file_splice_read,
206 .unlocked_ioctl = hpfs_ioctl,
206}; 207};
207 208
208const struct inode_operations hpfs_file_iops = 209const struct inode_operations hpfs_file_iops =
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index bb04b58d1d69..c4867b5116dd 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -18,6 +18,8 @@
18#include <linux/pagemap.h> 18#include <linux/pagemap.h>
19#include <linux/buffer_head.h> 19#include <linux/buffer_head.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/sched.h>
22#include <linux/blkdev.h>
21#include <asm/unaligned.h> 23#include <asm/unaligned.h>
22 24
23#include "hpfs.h" 25#include "hpfs.h"
@@ -200,6 +202,7 @@ void hpfs_free_dnode(struct super_block *, secno);
200struct dnode *hpfs_alloc_dnode(struct super_block *, secno, dnode_secno *, struct quad_buffer_head *); 202struct dnode *hpfs_alloc_dnode(struct super_block *, secno, dnode_secno *, struct quad_buffer_head *);
201struct fnode *hpfs_alloc_fnode(struct super_block *, secno, fnode_secno *, struct buffer_head **); 203struct fnode *hpfs_alloc_fnode(struct super_block *, secno, fnode_secno *, struct buffer_head **);
202struct anode *hpfs_alloc_anode(struct super_block *, secno, anode_secno *, struct buffer_head **); 204struct anode *hpfs_alloc_anode(struct super_block *, secno, anode_secno *, struct buffer_head **);
205int hpfs_trim_fs(struct super_block *, u64, u64, u64, unsigned *);
203 206
204/* anode.c */ 207/* anode.c */
205 208
@@ -318,6 +321,7 @@ __printf(2, 3)
318void hpfs_error(struct super_block *, const char *, ...); 321void hpfs_error(struct super_block *, const char *, ...);
319int hpfs_stop_cycles(struct super_block *, int, int *, int *, char *); 322int hpfs_stop_cycles(struct super_block *, int, int *, int *, char *);
320unsigned hpfs_get_free_dnodes(struct super_block *); 323unsigned hpfs_get_free_dnodes(struct super_block *);
324long hpfs_ioctl(struct file *file, unsigned cmd, unsigned long arg);
321 325
322/* 326/*
323 * local time (HPFS) to GMT (Unix) 327 * local time (HPFS) to GMT (Unix)
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 7cd00d3a7c9b..68a9bed05628 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -52,17 +52,20 @@ static void unmark_dirty(struct super_block *s)
52} 52}
53 53
54/* Filesystem error... */ 54/* Filesystem error... */
55static char err_buf[1024];
56
57void hpfs_error(struct super_block *s, const char *fmt, ...) 55void hpfs_error(struct super_block *s, const char *fmt, ...)
58{ 56{
57 struct va_format vaf;
59 va_list args; 58 va_list args;
60 59
61 va_start(args, fmt); 60 va_start(args, fmt);
62 vsnprintf(err_buf, sizeof(err_buf), fmt, args); 61
62 vaf.fmt = fmt;
63 vaf.va = &args;
64
65 pr_err("filesystem error: %pV", &vaf);
66
63 va_end(args); 67 va_end(args);
64 68
65 pr_err("filesystem error: %s", err_buf);
66 if (!hpfs_sb(s)->sb_was_error) { 69 if (!hpfs_sb(s)->sb_was_error) {
67 if (hpfs_sb(s)->sb_err == 2) { 70 if (hpfs_sb(s)->sb_err == 2) {
68 pr_cont("; crashing the system because you wanted it\n"); 71 pr_cont("; crashing the system because you wanted it\n");
@@ -196,12 +199,39 @@ static int hpfs_statfs(struct dentry *dentry, struct kstatfs *buf)
196 return 0; 199 return 0;
197} 200}
198 201
202
203long hpfs_ioctl(struct file *file, unsigned cmd, unsigned long arg)
204{
205 switch (cmd) {
206 case FITRIM: {
207 struct fstrim_range range;
208 secno n_trimmed;
209 int r;
210 if (!capable(CAP_SYS_ADMIN))
211 return -EPERM;
212 if (copy_from_user(&range, (struct fstrim_range __user *)arg, sizeof(range)))
213 return -EFAULT;
214 r = hpfs_trim_fs(file_inode(file)->i_sb, range.start >> 9, (range.start + range.len) >> 9, (range.minlen + 511) >> 9, &n_trimmed);
215 if (r)
216 return r;
217 range.len = (u64)n_trimmed << 9;
218 if (copy_to_user((struct fstrim_range __user *)arg, &range, sizeof(range)))
219 return -EFAULT;
220 return 0;
221 }
222 default: {
223 return -ENOIOCTLCMD;
224 }
225 }
226}
227
228
199static struct kmem_cache * hpfs_inode_cachep; 229static struct kmem_cache * hpfs_inode_cachep;
200 230
201static struct inode *hpfs_alloc_inode(struct super_block *sb) 231static struct inode *hpfs_alloc_inode(struct super_block *sb)
202{ 232{
203 struct hpfs_inode_info *ei; 233 struct hpfs_inode_info *ei;
204 ei = (struct hpfs_inode_info *)kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS); 234 ei = kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS);
205 if (!ei) 235 if (!ei)
206 return NULL; 236 return NULL;
207 ei->vfs_inode.i_version = 1; 237 ei->vfs_inode.i_version = 1;
@@ -424,11 +454,14 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
424 int o; 454 int o;
425 struct hpfs_sb_info *sbi = hpfs_sb(s); 455 struct hpfs_sb_info *sbi = hpfs_sb(s);
426 char *new_opts = kstrdup(data, GFP_KERNEL); 456 char *new_opts = kstrdup(data, GFP_KERNEL);
427 457
458 if (!new_opts)
459 return -ENOMEM;
460
428 sync_filesystem(s); 461 sync_filesystem(s);
429 462
430 *flags |= MS_NOATIME; 463 *flags |= MS_NOATIME;
431 464
432 hpfs_lock(s); 465 hpfs_lock(s);
433 uid = sbi->sb_uid; gid = sbi->sb_gid; 466 uid = sbi->sb_uid; gid = sbi->sb_gid;
434 umask = 0777 & ~sbi->sb_mode; 467 umask = 0777 & ~sbi->sb_mode;
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c
index 93a1232894f6..8db8b7d61e40 100644
--- a/fs/jfs/ioctl.c
+++ b/fs/jfs/ioctl.c
@@ -180,9 +180,6 @@ long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
180 case JFS_IOC_SETFLAGS32: 180 case JFS_IOC_SETFLAGS32:
181 cmd = JFS_IOC_SETFLAGS; 181 cmd = JFS_IOC_SETFLAGS;
182 break; 182 break;
183 case FITRIM:
184 cmd = FITRIM;
185 break;
186 } 183 }
187 return jfs_ioctl(filp, cmd, arg); 184 return jfs_ioctl(filp, cmd, arg);
188} 185}
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 9a20e513d7eb..aba43811d6ef 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -1369,7 +1369,6 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1369 case NILFS_IOCTL_SYNC: 1369 case NILFS_IOCTL_SYNC:
1370 case NILFS_IOCTL_RESIZE: 1370 case NILFS_IOCTL_RESIZE:
1371 case NILFS_IOCTL_SET_ALLOC_RANGE: 1371 case NILFS_IOCTL_SET_ALLOC_RANGE:
1372 case FITRIM:
1373 break; 1372 break;
1374 default: 1373 default:
1375 return -ENOIOCTLCMD; 1374 return -ENOIOCTLCMD;
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 53e6c40ed4c6..3cb097ccce60 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -980,7 +980,6 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
980 case OCFS2_IOC_GROUP_EXTEND: 980 case OCFS2_IOC_GROUP_EXTEND:
981 case OCFS2_IOC_GROUP_ADD: 981 case OCFS2_IOC_GROUP_ADD:
982 case OCFS2_IOC_GROUP_ADD64: 982 case OCFS2_IOC_GROUP_ADD64:
983 case FITRIM:
984 break; 983 break;
985 case OCFS2_IOC_REFLINK: 984 case OCFS2_IOC_REFLINK:
986 if (copy_from_user(&args, argp, sizeof(args))) 985 if (copy_from_user(&args, argp, sizeof(args)))
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c471dfc93b71..d2445fa9999f 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -58,6 +58,19 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
58 acpi_fwnode_handle(adev) : NULL) 58 acpi_fwnode_handle(adev) : NULL)
59#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) 59#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev))
60 60
61/**
62 * ACPI_DEVICE_CLASS - macro used to describe an ACPI device with
63 * the PCI-defined class-code information
64 *
65 * @_cls : the class, subclass, prog-if triple for this device
66 * @_msk : the class mask for this device
67 *
68 * This macro is used to create a struct acpi_device_id that matches a
69 * specific PCI class. The .id and .driver_data fields will be left
70 * initialized with the default value.
71 */
72#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (_cls), .cls_msk = (_msk),
73
61static inline bool has_acpi_companion(struct device *dev) 74static inline bool has_acpi_companion(struct device *dev)
62{ 75{
63 return is_acpi_node(dev->fwnode); 76 return is_acpi_node(dev->fwnode);
@@ -309,9 +322,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
309 322
310int acpi_resources_are_enforced(void); 323int acpi_resources_are_enforced(void);
311 324
312int acpi_reserve_region(u64 start, unsigned int length, u8 space_id,
313 unsigned long flags, char *desc);
314
315#ifdef CONFIG_HIBERNATION 325#ifdef CONFIG_HIBERNATION
316void __init acpi_no_s4_hw_signature(void); 326void __init acpi_no_s4_hw_signature(void);
317#endif 327#endif
@@ -446,6 +456,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *);
446#define ACPI_COMPANION(dev) (NULL) 456#define ACPI_COMPANION(dev) (NULL)
447#define ACPI_COMPANION_SET(dev, adev) do { } while (0) 457#define ACPI_COMPANION_SET(dev, adev) do { } while (0)
448#define ACPI_HANDLE(dev) (NULL) 458#define ACPI_HANDLE(dev) (NULL)
459#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (0), .cls_msk = (0),
449 460
450struct fwnode_handle; 461struct fwnode_handle;
451 462
@@ -507,13 +518,6 @@ static inline int acpi_check_region(resource_size_t start, resource_size_t n,
507 return 0; 518 return 0;
508} 519}
509 520
510static inline int acpi_reserve_region(u64 start, unsigned int length,
511 u8 space_id, unsigned long flags,
512 char *desc)
513{
514 return -ENXIO;
515}
516
517struct acpi_table_header; 521struct acpi_table_header;
518static inline int acpi_table_parse(char *id, 522static inline int acpi_table_parse(char *id,
519 int (*handler)(struct acpi_table_header *)) 523 int (*handler)(struct acpi_table_header *))
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index e15499422fdc..37753278987a 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -8,6 +8,7 @@
8#include <linux/radix-tree.h> 8#include <linux/radix-tree.h>
9#include <linux/uio.h> 9#include <linux/uio.h>
10#include <linux/workqueue.h> 10#include <linux/workqueue.h>
11#include <net/net_namespace.h>
11 12
12#include <linux/ceph/types.h> 13#include <linux/ceph/types.h>
13#include <linux/ceph/buffer.h> 14#include <linux/ceph/buffer.h>
@@ -56,6 +57,7 @@ struct ceph_messenger {
56 struct ceph_entity_addr my_enc_addr; 57 struct ceph_entity_addr my_enc_addr;
57 58
58 atomic_t stopping; 59 atomic_t stopping;
60 possible_net_t net;
59 bool nocrc; 61 bool nocrc;
60 bool tcp_nodelay; 62 bool tcp_nodelay;
61 63
@@ -267,6 +269,7 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr,
267 u64 required_features, 269 u64 required_features,
268 bool nocrc, 270 bool nocrc,
269 bool tcp_nodelay); 271 bool tcp_nodelay);
272extern void ceph_messenger_fini(struct ceph_messenger *msgr);
270 273
271extern void ceph_con_init(struct ceph_connection *con, void *private, 274extern void ceph_con_init(struct ceph_connection *con, void *private,
272 const struct ceph_connection_operations *ops, 275 const struct ceph_connection_operations *ops,
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 8183d6640ca7..34f25b7bf642 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -189,6 +189,8 @@ struct css_device_id {
189struct acpi_device_id { 189struct acpi_device_id {
190 __u8 id[ACPI_ID_LEN]; 190 __u8 id[ACPI_ID_LEN];
191 kernel_ulong_t driver_data; 191 kernel_ulong_t driver_data;
192 __u32 cls;
193 __u32 cls_msk;
192}; 194};
193 195
194#define PNP_ID_LEN 8 196#define PNP_ID_LEN 8
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 09c65640cad6..e85bdfd15fed 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1021,8 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
1021 * for strings that are too long, we should not have created 1021 * for strings that are too long, we should not have created
1022 * any. 1022 * any.
1023 */ 1023 */
1024 if (unlikely((len == 0) || len > MAX_ARG_STRLEN - 1)) { 1024 if (WARN_ON_ONCE(len < 0 || len > MAX_ARG_STRLEN - 1)) {
1025 WARN_ON(1);
1026 send_sig(SIGKILL, current, 0); 1025 send_sig(SIGKILL, current, 0);
1027 return -1; 1026 return -1;
1028 } 1027 }
diff --git a/kernel/module.c b/kernel/module.c
index 3e0e19763d24..4d2b82e610e2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3557,6 +3557,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
3557 mutex_lock(&module_mutex); 3557 mutex_lock(&module_mutex);
3558 /* Unlink carefully: kallsyms could be walking list. */ 3558 /* Unlink carefully: kallsyms could be walking list. */
3559 list_del_rcu(&mod->list); 3559 list_del_rcu(&mod->list);
3560 mod_tree_remove(mod);
3560 wake_up_all(&module_wq); 3561 wake_up_all(&module_wq);
3561 /* Wait for RCU-sched synchronizing before releasing mod->list. */ 3562 /* Wait for RCU-sched synchronizing before releasing mod->list. */
3562 synchronize_sched(); 3563 synchronize_sched();
diff --git a/mm/memory.c b/mm/memory.c
index a84fbb772034..388dcf9aa283 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2670,6 +2670,10 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
2670 2670
2671 pte_unmap(page_table); 2671 pte_unmap(page_table);
2672 2672
2673 /* File mapping without ->vm_ops ? */
2674 if (vma->vm_flags & VM_SHARED)
2675 return VM_FAULT_SIGBUS;
2676
2673 /* Check if we need to add a guard page to the stack */ 2677 /* Check if we need to add a guard page to the stack */
2674 if (check_stack_guard_page(vma, address) < 0) 2678 if (check_stack_guard_page(vma, address) < 0)
2675 return VM_FAULT_SIGSEGV; 2679 return VM_FAULT_SIGSEGV;
@@ -3099,6 +3103,9 @@ static int do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
3099 - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; 3103 - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
3100 3104
3101 pte_unmap(page_table); 3105 pte_unmap(page_table);
3106 /* The VMA was not fully populated on mmap() or missing VM_DONTEXPAND */
3107 if (!vma->vm_ops->fault)
3108 return VM_FAULT_SIGBUS;
3102 if (!(flags & FAULT_FLAG_WRITE)) 3109 if (!(flags & FAULT_FLAG_WRITE))
3103 return do_read_fault(mm, vma, address, pmd, pgoff, flags, 3110 return do_read_fault(mm, vma, address, pmd, pgoff, flags,
3104 orig_pte); 3111 orig_pte);
@@ -3244,13 +3251,12 @@ static int handle_pte_fault(struct mm_struct *mm,
3244 barrier(); 3251 barrier();
3245 if (!pte_present(entry)) { 3252 if (!pte_present(entry)) {
3246 if (pte_none(entry)) { 3253 if (pte_none(entry)) {
3247 if (vma->vm_ops) { 3254 if (vma->vm_ops)
3248 if (likely(vma->vm_ops->fault)) 3255 return do_fault(mm, vma, address, pte, pmd,
3249 return do_fault(mm, vma, address, pte, 3256 flags, entry);
3250 pmd, flags, entry); 3257
3251 } 3258 return do_anonymous_page(mm, vma, address, pte, pmd,
3252 return do_anonymous_page(mm, vma, address, 3259 flags);
3253 pte, pmd, flags);
3254 } 3260 }
3255 return do_swap_page(mm, vma, address, 3261 return do_swap_page(mm, vma, address,
3256 pte, pmd, flags, entry); 3262 pte, pmd, flags, entry);
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index cb7db320dd27..f30329f72641 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -9,6 +9,7 @@
9#include <keys/ceph-type.h> 9#include <keys/ceph-type.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/mount.h> 11#include <linux/mount.h>
12#include <linux/nsproxy.h>
12#include <linux/parser.h> 13#include <linux/parser.h>
13#include <linux/sched.h> 14#include <linux/sched.h>
14#include <linux/seq_file.h> 15#include <linux/seq_file.h>
@@ -16,8 +17,6 @@
16#include <linux/statfs.h> 17#include <linux/statfs.h>
17#include <linux/string.h> 18#include <linux/string.h>
18#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
19#include <linux/nsproxy.h>
20#include <net/net_namespace.h>
21 20
22 21
23#include <linux/ceph/ceph_features.h> 22#include <linux/ceph/ceph_features.h>
@@ -131,6 +130,13 @@ int ceph_compare_options(struct ceph_options *new_opt,
131 int i; 130 int i;
132 int ret; 131 int ret;
133 132
133 /*
134 * Don't bother comparing options if network namespaces don't
135 * match.
136 */
137 if (!net_eq(current->nsproxy->net_ns, read_pnet(&client->msgr.net)))
138 return -1;
139
134 ret = memcmp(opt1, opt2, ofs); 140 ret = memcmp(opt1, opt2, ofs);
135 if (ret) 141 if (ret)
136 return ret; 142 return ret;
@@ -335,9 +341,6 @@ ceph_parse_options(char *options, const char *dev_name,
335 int err = -ENOMEM; 341 int err = -ENOMEM;
336 substring_t argstr[MAX_OPT_ARGS]; 342 substring_t argstr[MAX_OPT_ARGS];
337 343
338 if (current->nsproxy->net_ns != &init_net)
339 return ERR_PTR(-EINVAL);
340
341 opt = kzalloc(sizeof(*opt), GFP_KERNEL); 344 opt = kzalloc(sizeof(*opt), GFP_KERNEL);
342 if (!opt) 345 if (!opt)
343 return ERR_PTR(-ENOMEM); 346 return ERR_PTR(-ENOMEM);
@@ -608,6 +611,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private,
608fail_monc: 611fail_monc:
609 ceph_monc_stop(&client->monc); 612 ceph_monc_stop(&client->monc);
610fail: 613fail:
614 ceph_messenger_fini(&client->msgr);
611 kfree(client); 615 kfree(client);
612 return ERR_PTR(err); 616 return ERR_PTR(err);
613} 617}
@@ -621,8 +625,8 @@ void ceph_destroy_client(struct ceph_client *client)
621 625
622 /* unmount */ 626 /* unmount */
623 ceph_osdc_stop(&client->osdc); 627 ceph_osdc_stop(&client->osdc);
624
625 ceph_monc_stop(&client->monc); 628 ceph_monc_stop(&client->monc);
629 ceph_messenger_fini(&client->msgr);
626 630
627 ceph_debugfs_client_cleanup(client); 631 ceph_debugfs_client_cleanup(client);
628 632
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 1679f47280e2..e3be1d22a247 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -6,6 +6,7 @@
6#include <linux/inet.h> 6#include <linux/inet.h>
7#include <linux/kthread.h> 7#include <linux/kthread.h>
8#include <linux/net.h> 8#include <linux/net.h>
9#include <linux/nsproxy.h>
9#include <linux/slab.h> 10#include <linux/slab.h>
10#include <linux/socket.h> 11#include <linux/socket.h>
11#include <linux/string.h> 12#include <linux/string.h>
@@ -479,7 +480,7 @@ static int ceph_tcp_connect(struct ceph_connection *con)
479 int ret; 480 int ret;
480 481
481 BUG_ON(con->sock); 482 BUG_ON(con->sock);
482 ret = sock_create_kern(&init_net, con->peer_addr.in_addr.ss_family, 483 ret = sock_create_kern(read_pnet(&con->msgr->net), paddr->ss_family,
483 SOCK_STREAM, IPPROTO_TCP, &sock); 484 SOCK_STREAM, IPPROTO_TCP, &sock);
484 if (ret) 485 if (ret)
485 return ret; 486 return ret;
@@ -1731,17 +1732,17 @@ static int verify_hello(struct ceph_connection *con)
1731 1732
1732static bool addr_is_blank(struct sockaddr_storage *ss) 1733static bool addr_is_blank(struct sockaddr_storage *ss)
1733{ 1734{
1735 struct in_addr *addr = &((struct sockaddr_in *)ss)->sin_addr;
1736 struct in6_addr *addr6 = &((struct sockaddr_in6 *)ss)->sin6_addr;
1737
1734 switch (ss->ss_family) { 1738 switch (ss->ss_family) {
1735 case AF_INET: 1739 case AF_INET:
1736 return ((struct sockaddr_in *)ss)->sin_addr.s_addr == 0; 1740 return addr->s_addr == htonl(INADDR_ANY);
1737 case AF_INET6: 1741 case AF_INET6:
1738 return 1742 return ipv6_addr_any(addr6);
1739 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[0] == 0 && 1743 default:
1740 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[1] == 0 && 1744 return true;
1741 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[2] == 0 &&
1742 ((struct sockaddr_in6 *)ss)->sin6_addr.s6_addr32[3] == 0;
1743 } 1745 }
1744 return false;
1745} 1746}
1746 1747
1747static int addr_port(struct sockaddr_storage *ss) 1748static int addr_port(struct sockaddr_storage *ss)
@@ -2944,11 +2945,18 @@ void ceph_messenger_init(struct ceph_messenger *msgr,
2944 msgr->tcp_nodelay = tcp_nodelay; 2945 msgr->tcp_nodelay = tcp_nodelay;
2945 2946
2946 atomic_set(&msgr->stopping, 0); 2947 atomic_set(&msgr->stopping, 0);
2948 write_pnet(&msgr->net, get_net(current->nsproxy->net_ns));
2947 2949
2948 dout("%s %p\n", __func__, msgr); 2950 dout("%s %p\n", __func__, msgr);
2949} 2951}
2950EXPORT_SYMBOL(ceph_messenger_init); 2952EXPORT_SYMBOL(ceph_messenger_init);
2951 2953
2954void ceph_messenger_fini(struct ceph_messenger *msgr)
2955{
2956 put_net(read_pnet(&msgr->net));
2957}
2958EXPORT_SYMBOL(ceph_messenger_fini);
2959
2952static void clear_standby(struct ceph_connection *con) 2960static void clear_standby(struct ceph_connection *con)
2953{ 2961{
2954 /* come back from STANDBY? */ 2962 /* come back from STANDBY? */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index eff7de1fc82e..e70fcd12eeeb 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -63,6 +63,8 @@ int main(void)
63 63
64 DEVID(acpi_device_id); 64 DEVID(acpi_device_id);
65 DEVID_FIELD(acpi_device_id, id); 65 DEVID_FIELD(acpi_device_id, id);
66 DEVID_FIELD(acpi_device_id, cls);
67 DEVID_FIELD(acpi_device_id, cls_msk);
66 68
67 DEVID(pnp_device_id); 69 DEVID(pnp_device_id);
68 DEVID_FIELD(pnp_device_id, id); 70 DEVID_FIELD(pnp_device_id, id);
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 84c86f3cd6cd..5f2088209132 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -523,12 +523,40 @@ static int do_serio_entry(const char *filename,
523} 523}
524ADD_TO_DEVTABLE("serio", serio_device_id, do_serio_entry); 524ADD_TO_DEVTABLE("serio", serio_device_id, do_serio_entry);
525 525
526/* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */ 526/* looks like: "acpi:ACPI0003" or "acpi:PNP0C0B" or "acpi:LNXVIDEO" or
527 * "acpi:bbsspp" (bb=base-class, ss=sub-class, pp=prog-if)
528 *
529 * NOTE: Each driver should use one of the following : _HID, _CIDs
530 * or _CLS. Also, bb, ss, and pp can be substituted with ??
531 * as don't care byte.
532 */
527static int do_acpi_entry(const char *filename, 533static int do_acpi_entry(const char *filename,
528 void *symval, char *alias) 534 void *symval, char *alias)
529{ 535{
530 DEF_FIELD_ADDR(symval, acpi_device_id, id); 536 DEF_FIELD_ADDR(symval, acpi_device_id, id);
531 sprintf(alias, "acpi*:%s:*", *id); 537 DEF_FIELD_ADDR(symval, acpi_device_id, cls);
538 DEF_FIELD_ADDR(symval, acpi_device_id, cls_msk);
539
540 if (id && strlen((const char *)*id))
541 sprintf(alias, "acpi*:%s:*", *id);
542 else if (cls) {
543 int i, byte_shift, cnt = 0;
544 unsigned int msk;
545
546 sprintf(&alias[cnt], "acpi*:");
547 cnt = 6;
548 for (i = 1; i <= 3; i++) {
549 byte_shift = 8 * (3-i);
550 msk = (*cls_msk >> byte_shift) & 0xFF;
551 if (msk)
552 sprintf(&alias[cnt], "%02x",
553 (*cls >> byte_shift) & 0xFF);
554 else
555 sprintf(&alias[cnt], "??");
556 cnt += 2;
557 }
558 sprintf(&alias[cnt], ":*");
559 }
532 return 1; 560 return 1;
533} 561}
534ADD_TO_DEVTABLE("acpi", acpi_device_id, do_acpi_entry); 562ADD_TO_DEVTABLE("acpi", acpi_device_id, do_acpi_entry);
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 91ee1b2e0f9a..12d3db3bd46b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -886,7 +886,8 @@ static void check_section(const char *modname, struct elf_info *elf,
886#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \ 886#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \
887 ".kprobes.text" 887 ".kprobes.text"
888#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ 888#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
889 ".fixup", ".entry.text", ".exception.text", ".text.*" 889 ".fixup", ".entry.text", ".exception.text", ".text.*", \
890 ".coldtext"
890 891
891#define INIT_SECTIONS ".init.*" 892#define INIT_SECTIONS ".init.*"
892#define MEM_INIT_SECTIONS ".meminit.*" 893#define MEM_INIT_SECTIONS ".meminit.*"