mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge branches 'arm/exynos', 'arm/omap', 'arm/rockchip', 'arm/mediatek', 'arm/smmu', 'arm/core', 'x86/vt-d', 'x86/amd' and 'core' into next
This commit is contained in:
parent
d5bf739dc7
fd8e2d4b39
c9d9f2394c
6f66ea099f
bdf9592308
26b37b946a
8e12188400
73dbd4a423
290d638e04
commit
2c0248d688
1088 changed files with 14792 additions and 7778 deletions
|
|
@ -2,7 +2,6 @@
|
|||
# Makefile for the Linux ACPI interpreter
|
||||
#
|
||||
|
||||
ccflags-y := -Os
|
||||
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -25,9 +25,11 @@
|
|||
ACPI_MODULE_NAME("platform");
|
||||
|
||||
static const struct acpi_device_id forbidden_id_list[] = {
|
||||
{"PNP0000", 0}, /* PIC */
|
||||
{"PNP0100", 0}, /* Timer */
|
||||
{"PNP0200", 0}, /* AT DMA Controller */
|
||||
{"PNP0000", 0}, /* PIC */
|
||||
{"PNP0100", 0}, /* Timer */
|
||||
{"PNP0200", 0}, /* AT DMA Controller */
|
||||
{"ACPI0009", 0}, /* IOxAPIC */
|
||||
{"ACPI000A", 0}, /* IOAPIC */
|
||||
{"", 0},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -421,10 +421,8 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
|
|||
|
||||
ACPI_FUNCTION_TRACE(ut_walk_aml_resources);
|
||||
|
||||
/*
|
||||
* The absolute minimum resource template is one end_tag descriptor.
|
||||
* However, we will treat a lone end_tag as just a simple buffer.
|
||||
*/
|
||||
/* The absolute minimum resource template is one end_tag descriptor */
|
||||
|
||||
if (aml_length < sizeof(struct aml_resource_end_tag)) {
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
|
@ -456,8 +454,9 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
|
|||
/* Invoke the user function */
|
||||
|
||||
if (user_function) {
|
||||
status = user_function(aml, length, offset,
|
||||
resource_index, context);
|
||||
status =
|
||||
user_function(aml, length, offset, resource_index,
|
||||
context);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -481,12 +480,6 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
|
|||
*context = aml;
|
||||
}
|
||||
|
||||
/* Check if buffer is defined to be longer than the resource length */
|
||||
|
||||
if (aml_length > (offset + length)) {
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
||||
/* Normal exit */
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
|
|
|
|||
|
|
@ -1073,6 +1073,7 @@ static int ghes_remove(struct platform_device *ghes_dev)
|
|||
if (list_empty(&ghes_sci))
|
||||
unregister_acpi_hed_notifier(&ghes_notifier_sci);
|
||||
mutex_unlock(&ghes_list_mutex);
|
||||
synchronize_rcu();
|
||||
break;
|
||||
case ACPI_HEST_NOTIFY_NMI:
|
||||
ghes_nmi_remove(ghes);
|
||||
|
|
|
|||
|
|
@ -523,6 +523,46 @@ static int arm_smmu_iort_xlate(struct device *dev, u32 streamid,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline bool iort_iommu_driver_enabled(u8 type)
|
||||
{
|
||||
switch (type) {
|
||||
case ACPI_IORT_NODE_SMMU_V3:
|
||||
return IS_BUILTIN(CONFIG_ARM_SMMU_V3);
|
||||
case ACPI_IORT_NODE_SMMU:
|
||||
return IS_BUILTIN(CONFIG_ARM_SMMU);
|
||||
default:
|
||||
pr_warn("IORT node type %u does not describe an SMMU\n", type);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IOMMU_API
|
||||
static inline
|
||||
const struct iommu_ops *iort_fwspec_iommu_ops(struct iommu_fwspec *fwspec)
|
||||
{
|
||||
return (fwspec && fwspec->ops) ? fwspec->ops : NULL;
|
||||
}
|
||||
|
||||
static inline
|
||||
int iort_add_device_replay(const struct iommu_ops *ops, struct device *dev)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (!IS_ERR_OR_NULL(ops) && ops->add_device && dev->bus &&
|
||||
!dev->iommu_group)
|
||||
err = ops->add_device(dev);
|
||||
|
||||
return err;
|
||||
}
|
||||
#else
|
||||
static inline
|
||||
const struct iommu_ops *iort_fwspec_iommu_ops(struct iommu_fwspec *fwspec)
|
||||
{ return NULL; }
|
||||
static inline
|
||||
int iort_add_device_replay(const struct iommu_ops *ops, struct device *dev)
|
||||
{ return 0; }
|
||||
#endif
|
||||
|
||||
static const struct iommu_ops *iort_iommu_xlate(struct device *dev,
|
||||
struct acpi_iort_node *node,
|
||||
u32 streamid)
|
||||
|
|
@ -531,14 +571,31 @@ static const struct iommu_ops *iort_iommu_xlate(struct device *dev,
|
|||
int ret = -ENODEV;
|
||||
struct fwnode_handle *iort_fwnode;
|
||||
|
||||
/*
|
||||
* If we already translated the fwspec there
|
||||
* is nothing left to do, return the iommu_ops.
|
||||
*/
|
||||
ops = iort_fwspec_iommu_ops(dev->iommu_fwspec);
|
||||
if (ops)
|
||||
return ops;
|
||||
|
||||
if (node) {
|
||||
iort_fwnode = iort_get_fwnode(node);
|
||||
if (!iort_fwnode)
|
||||
return NULL;
|
||||
|
||||
ops = iommu_ops_from_fwnode(iort_fwnode);
|
||||
/*
|
||||
* If the ops look-up fails, this means that either
|
||||
* the SMMU drivers have not been probed yet or that
|
||||
* the SMMU drivers are not built in the kernel;
|
||||
* Depending on whether the SMMU drivers are built-in
|
||||
* in the kernel or not, defer the IOMMU configuration
|
||||
* or just abort it.
|
||||
*/
|
||||
if (!ops)
|
||||
return NULL;
|
||||
return iort_iommu_driver_enabled(node->type) ?
|
||||
ERR_PTR(-EPROBE_DEFER) : NULL;
|
||||
|
||||
ret = arm_smmu_iort_xlate(dev, streamid, iort_fwnode, ops);
|
||||
}
|
||||
|
|
@ -581,6 +638,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
|
|||
struct acpi_iort_node *node, *parent;
|
||||
const struct iommu_ops *ops = NULL;
|
||||
u32 streamid = 0;
|
||||
int err;
|
||||
|
||||
if (dev_is_pci(dev)) {
|
||||
struct pci_bus *bus = to_pci_dev(dev)->bus;
|
||||
|
|
@ -612,12 +670,22 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
|
|||
|
||||
while (parent) {
|
||||
ops = iort_iommu_xlate(dev, parent, streamid);
|
||||
if (IS_ERR_OR_NULL(ops))
|
||||
return ops;
|
||||
|
||||
parent = iort_node_get_id(node, &streamid,
|
||||
IORT_IOMMU_TYPE, i++);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have reason to believe the IOMMU driver missed the initial
|
||||
* add_device callback for dev, replay it to get things in order.
|
||||
*/
|
||||
err = iort_add_device_replay(ops, dev);
|
||||
if (err)
|
||||
ops = ERR_PTR(err);
|
||||
|
||||
return ops;
|
||||
}
|
||||
|
||||
|
|
@ -956,6 +1024,4 @@ void __init acpi_iort_init(void)
|
|||
}
|
||||
|
||||
iort_init_platform_devices();
|
||||
|
||||
acpi_probe_device_table(iort);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,13 +99,13 @@ static int find_child_checks(struct acpi_device *adev, bool check_children)
|
|||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* If the device has a _HID (or _CID) returning a valid ACPI/PNP
|
||||
* device ID, it is better to make it look less attractive here, so that
|
||||
* the other device with the same _ADR value (that may not have a valid
|
||||
* device ID) can be matched going forward. [This means a second spec
|
||||
* violation in a row, so whatever we do here is best effort anyway.]
|
||||
* If the device has a _HID returning a valid ACPI/PNP device ID, it is
|
||||
* better to make it look less attractive here, so that the other device
|
||||
* with the same _ADR value (that may not have a valid device ID) can be
|
||||
* matched going forward. [This means a second spec violation in a row,
|
||||
* so whatever we do here is best effort anyway.]
|
||||
*/
|
||||
return sta_present && list_empty(&adev->pnp.ids) ?
|
||||
return sta_present && !adev->pnp.type.platform_id ?
|
||||
FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,6 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
|
|||
struct list_head *physnode_list;
|
||||
unsigned int node_id;
|
||||
int retval = -EINVAL;
|
||||
enum dev_dma_attr attr;
|
||||
|
||||
if (has_acpi_companion(dev)) {
|
||||
if (acpi_dev) {
|
||||
|
|
@ -233,10 +232,6 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
|
|||
if (!has_acpi_companion(dev))
|
||||
ACPI_COMPANION_SET(dev, acpi_dev);
|
||||
|
||||
attr = acpi_get_dma_attr(acpi_dev);
|
||||
if (attr != DEV_DMA_NOT_SUPPORTED)
|
||||
acpi_dma_configure(dev, attr);
|
||||
|
||||
acpi_physnode_link_name(physical_node_name, node_id);
|
||||
retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj,
|
||||
physical_node_name);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,12 @@ static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
|
|||
struct resource *res = data;
|
||||
struct resource_win win;
|
||||
|
||||
/*
|
||||
* We might assign this to 'res' later, make sure all pointers are
|
||||
* cleared before the resource is added to the global list
|
||||
*/
|
||||
memset(&win, 0, sizeof(win));
|
||||
|
||||
res->flags = 0;
|
||||
if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM))
|
||||
return AE_OK;
|
||||
|
|
|
|||
|
|
@ -1617,7 +1617,11 @@ static int cmp_map(const void *m0, const void *m1)
|
|||
const struct nfit_set_info_map *map0 = m0;
|
||||
const struct nfit_set_info_map *map1 = m1;
|
||||
|
||||
return map0->region_offset - map1->region_offset;
|
||||
if (map0->region_offset < map1->region_offset)
|
||||
return -1;
|
||||
else if (map0->region_offset > map1->region_offset)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Retrieve the nth entry referencing this spa */
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ static int acpi_power_get_list_state(struct list_head *list, int *state)
|
|||
return -EINVAL;
|
||||
|
||||
/* The state of the list is 'on' IFF all resources are 'on'. */
|
||||
cur_state = 0;
|
||||
list_for_each_entry(entry, list, node) {
|
||||
struct acpi_power_resource *resource = entry->resource;
|
||||
acpi_handle handle = resource->device.handle;
|
||||
|
|
|
|||
|
|
@ -1373,20 +1373,25 @@ enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev)
|
|||
* @dev: The pointer to the device
|
||||
* @attr: device dma attributes
|
||||
*/
|
||||
void acpi_dma_configure(struct device *dev, enum dev_dma_attr attr)
|
||||
int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr)
|
||||
{
|
||||
const struct iommu_ops *iommu;
|
||||
u64 size;
|
||||
|
||||
iort_set_dma_mask(dev);
|
||||
|
||||
iommu = iort_iommu_configure(dev);
|
||||
if (IS_ERR(iommu))
|
||||
return PTR_ERR(iommu);
|
||||
|
||||
size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1);
|
||||
/*
|
||||
* Assume dma valid range starts at 0 and covers the whole
|
||||
* coherent_dma_mask.
|
||||
*/
|
||||
arch_setup_dma_ops(dev, 0, dev->coherent_dma_mask + 1, iommu,
|
||||
attr == DEV_DMA_COHERENT);
|
||||
arch_setup_dma_ops(dev, 0, size, iommu, attr == DEV_DMA_COHERENT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_dma_configure);
|
||||
|
||||
|
|
@ -1857,15 +1862,20 @@ static void acpi_bus_attach(struct acpi_device *device)
|
|||
return;
|
||||
|
||||
device->flags.match_driver = true;
|
||||
if (!ret) {
|
||||
ret = device_attach(&device->dev);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
if (!ret && device->pnp.type.platform_id)
|
||||
acpi_default_enumeration(device);
|
||||
if (ret > 0) {
|
||||
acpi_device_set_enumerated(device);
|
||||
goto ok;
|
||||
}
|
||||
|
||||
ret = device_attach(&device->dev);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
if (ret > 0 || !device->pnp.type.platform_id)
|
||||
acpi_device_set_enumerated(device);
|
||||
else
|
||||
acpi_default_enumeration(device);
|
||||
|
||||
ok:
|
||||
list_for_each_entry(child, &device->children, node)
|
||||
acpi_bus_attach(child);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ static bool qdf2400_erratum_44_present(struct acpi_table_header *h)
|
|||
return true;
|
||||
|
||||
if (!memcmp(h->oem_table_id, "QDF2400 ", ACPI_OEM_TABLE_ID_SIZE) &&
|
||||
h->oem_revision == 0)
|
||||
h->oem_revision == 1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue