Snap for 7952827
from fac10b59fe
to android12-5.10-keystone-qcom-release
Change-Id: I160c21c45edf16e26b274c1fd7438af55f1abd7a
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1673,6 +1673,7 @@
|
||||
trace_event_reg
|
||||
trace_handle_return
|
||||
__traceiter_android_rvh_account_irq
|
||||
__traceiter_android_rvh_binder_transaction
|
||||
__traceiter_android_rvh_build_perf_domains
|
||||
__traceiter_android_rvh_can_migrate_task
|
||||
__traceiter_android_rvh_check_preempt_wakeup
|
||||
@@ -1772,6 +1773,7 @@
|
||||
__traceiter_usb_gadget_connect
|
||||
__traceiter_usb_gadget_disconnect
|
||||
__tracepoint_android_rvh_account_irq
|
||||
__tracepoint_android_rvh_binder_transaction
|
||||
__tracepoint_android_rvh_build_perf_domains
|
||||
__tracepoint_android_rvh_can_migrate_task
|
||||
__tracepoint_android_rvh_check_preempt_wakeup
|
||||
|
@@ -386,6 +386,7 @@ CONFIG_HW_RANDOM=y
|
||||
# CONFIG_I2C_HELPER_AUTO is not set
|
||||
CONFIG_I3C=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_MEM=y
|
||||
CONFIG_SPMI=y
|
||||
# CONFIG_SPMI_MSM_PMIC_ARB is not set
|
||||
# CONFIG_PINCTRL_SUN8I_H3_R is not set
|
||||
|
@@ -62,6 +62,12 @@ EXPORT_SYMBOL(memstart_addr);
|
||||
*/
|
||||
phys_addr_t arm64_dma_phys_limit __ro_after_init;
|
||||
|
||||
/*
|
||||
* Provide a run-time mean of disabling ZONE_DMA32 if it is enabled via
|
||||
* CONFIG_ZONE_DMA32.
|
||||
*/
|
||||
static bool disable_dma32 __ro_after_init;
|
||||
|
||||
#ifdef CONFIG_KEXEC_CORE
|
||||
/*
|
||||
* reserve_crashkernel() - reserves memory for crash kernel
|
||||
@@ -207,7 +213,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
|
||||
max_zone_pfns[ZONE_DMA] = PFN_DOWN(arm64_dma_phys_limit);
|
||||
#endif
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
max_zone_pfns[ZONE_DMA32] = PFN_DOWN(dma32_phys_limit);
|
||||
max_zone_pfns[ZONE_DMA32] = disable_dma32 ? 0 : PFN_DOWN(dma32_phys_limit);
|
||||
if (!arm64_dma_phys_limit)
|
||||
arm64_dma_phys_limit = dma32_phys_limit;
|
||||
#endif
|
||||
@@ -218,6 +224,18 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
|
||||
free_area_init(max_zone_pfns);
|
||||
}
|
||||
|
||||
static int __init early_disable_dma32(char *buf)
|
||||
{
|
||||
if (!buf)
|
||||
return -EINVAL;
|
||||
|
||||
if (!strcmp(buf, "on"))
|
||||
disable_dma32 = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
early_param("disable_dma32", early_disable_dma32);
|
||||
|
||||
int pfn_valid(unsigned long pfn)
|
||||
{
|
||||
phys_addr_t addr = pfn << PAGE_SHIFT;
|
||||
|
@@ -351,6 +351,7 @@ CONFIG_HPET=y
|
||||
# CONFIG_I2C_HELPER_AUTO is not set
|
||||
CONFIG_I3C=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_MEM=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
# CONFIG_HWMON is not set
|
||||
|
@@ -102,6 +102,12 @@ static unsigned long min_pfn_mapped;
|
||||
|
||||
static bool __initdata can_use_brk_pgt = true;
|
||||
|
||||
/*
|
||||
* Provide a run-time mean of disabling ZONE_DMA32 if it is enabled via
|
||||
* CONFIG_ZONE_DMA32.
|
||||
*/
|
||||
static bool disable_dma32 __ro_after_init;
|
||||
|
||||
/*
|
||||
* Pages returned are already directly mapped.
|
||||
*
|
||||
@@ -996,7 +1002,7 @@ void __init zone_sizes_init(void)
|
||||
max_zone_pfns[ZONE_DMA] = min(MAX_DMA_PFN, max_low_pfn);
|
||||
#endif
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
max_zone_pfns[ZONE_DMA32] = min(MAX_DMA32_PFN, max_low_pfn);
|
||||
max_zone_pfns[ZONE_DMA32] = disable_dma32 ? 0 : min(MAX_DMA32_PFN, max_low_pfn);
|
||||
#endif
|
||||
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
@@ -1006,6 +1012,18 @@ void __init zone_sizes_init(void)
|
||||
free_area_init(max_zone_pfns);
|
||||
}
|
||||
|
||||
static int __init early_disable_dma32(char *buf)
|
||||
{
|
||||
if (!buf)
|
||||
return -EINVAL;
|
||||
|
||||
if (!strcmp(buf, "on"))
|
||||
disable_dma32 = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
early_param("disable_dma32", early_disable_dma32);
|
||||
|
||||
__visible DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = {
|
||||
.loaded_mm = &init_mm,
|
||||
.next_asid = 1,
|
||||
|
@@ -137,7 +137,7 @@ static int spi_check_buswidth_req(struct spi_mem *mem, u8 buswidth, bool tx)
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
bool spi_mem_default_supports_op(struct spi_mem *mem,
|
||||
static bool spi_mem_check_buswidth(struct spi_mem *mem,
|
||||
const struct spi_mem_op *op)
|
||||
{
|
||||
if (spi_check_buswidth_req(mem, op->cmd.buswidth, true))
|
||||
@@ -156,13 +156,29 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
|
||||
op->data.dir == SPI_MEM_DATA_OUT))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool spi_mem_dtr_supports_op(struct spi_mem *mem,
|
||||
const struct spi_mem_op *op)
|
||||
{
|
||||
if (op->cmd.nbytes != 2)
|
||||
return false;
|
||||
|
||||
return spi_mem_check_buswidth(mem, op);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spi_mem_dtr_supports_op);
|
||||
|
||||
bool spi_mem_default_supports_op(struct spi_mem *mem,
|
||||
const struct spi_mem_op *op)
|
||||
{
|
||||
if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr)
|
||||
return false;
|
||||
|
||||
if (op->cmd.nbytes != 1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return spi_mem_check_buswidth(mem, op);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spi_mem_default_supports_op);
|
||||
|
||||
|
@@ -678,8 +678,11 @@ fail:
|
||||
pr_err("acc_bind() could not allocate requests\n");
|
||||
while ((req = req_get(dev, &dev->tx_idle)))
|
||||
acc_request_free(req, dev->ep_in);
|
||||
for (i = 0; i < RX_REQ_MAX; i++)
|
||||
for (i = 0; i < RX_REQ_MAX; i++) {
|
||||
acc_request_free(dev->rx_req[i], dev->ep_out);
|
||||
dev->rx_req[i] = NULL;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -711,6 +714,12 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!dev->rx_req[0]) {
|
||||
pr_warn("acc_read: USB request already handled/freed");
|
||||
r = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the data length by considering termination character.
|
||||
* Then compansite the difference of rounding up to
|
||||
@@ -1187,8 +1196,10 @@ acc_function_unbind(struct usb_configuration *c, struct usb_function *f)
|
||||
|
||||
while ((req = req_get(dev, &dev->tx_idle)))
|
||||
acc_request_free(req, dev->ep_in);
|
||||
for (i = 0; i < RX_REQ_MAX; i++)
|
||||
for (i = 0; i < RX_REQ_MAX; i++) {
|
||||
acc_request_free(dev->rx_req[i], dev->ep_out);
|
||||
dev->rx_req[i] = NULL;
|
||||
}
|
||||
|
||||
acc_hid_unbind(dev);
|
||||
}
|
||||
|
@@ -634,7 +634,16 @@ static int ehci_run (struct usb_hcd *hcd)
|
||||
/* Wait until HC become operational */
|
||||
ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
|
||||
msleep(5);
|
||||
rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, 0, 100 * 1000);
|
||||
|
||||
/* For Aspeed, STS_HALT also depends on ASS/PSS status.
|
||||
* Check CMD_RUN instead.
|
||||
*/
|
||||
if (ehci->is_aspeed)
|
||||
rc = ehci_handshake(ehci, &ehci->regs->command, CMD_RUN,
|
||||
1, 100 * 1000);
|
||||
else
|
||||
rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT,
|
||||
0, 100 * 1000);
|
||||
|
||||
up_write(&ehci_cf_port_reset_rwsem);
|
||||
|
||||
|
@@ -294,6 +294,12 @@ static int ehci_platform_probe(struct platform_device *dev)
|
||||
"has-transaction-translator"))
|
||||
hcd->has_tt = 1;
|
||||
|
||||
if (of_device_is_compatible(dev->dev.of_node,
|
||||
"aspeed,ast2500-ehci") ||
|
||||
of_device_is_compatible(dev->dev.of_node,
|
||||
"aspeed,ast2600-ehci"))
|
||||
ehci->is_aspeed = 1;
|
||||
|
||||
if (soc_device_match(quirk_poll_match))
|
||||
priv->quirk_poll = true;
|
||||
|
||||
|
@@ -218,6 +218,13 @@ struct ehci_hcd { /* one per controller */
|
||||
unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */
|
||||
unsigned need_oc_pp_cycle:1; /* MPC834X port power */
|
||||
unsigned imx28_write_fix:1; /* For Freescale i.MX28 */
|
||||
/*
|
||||
* __GENKSYMS__ test is an abi workaround for commit
|
||||
* 7f2d73788d90 ("usb: ehci: handshake CMD_RUN * instead of STS_HALT")
|
||||
*/
|
||||
#ifndef __GENKSYMS__
|
||||
unsigned is_aspeed:1;
|
||||
#endif
|
||||
|
||||
/* required for usb32 quirk */
|
||||
#define OHCI_CTRL_HCFS (3 << 6)
|
||||
|
@@ -24,6 +24,28 @@ struct bus_dma_region {
|
||||
u64 offset;
|
||||
};
|
||||
|
||||
static inline bool zone_dma32_is_empty(int node)
|
||||
{
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
pg_data_t *pgdat = NODE_DATA(node);
|
||||
|
||||
return zone_is_empty(&pgdat->node_zones[ZONE_DMA32]);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool zone_dma32_are_empty(void)
|
||||
{
|
||||
int node;
|
||||
|
||||
for_each_node(node)
|
||||
if (!zone_dma32_is_empty(node))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline dma_addr_t translate_phys_to_dma(struct device *dev,
|
||||
phys_addr_t paddr)
|
||||
{
|
||||
|
@@ -311,6 +311,9 @@ void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
|
||||
bool spi_mem_default_supports_op(struct spi_mem *mem,
|
||||
const struct spi_mem_op *op);
|
||||
|
||||
bool spi_mem_dtr_supports_op(struct spi_mem *mem,
|
||||
const struct spi_mem_op *op);
|
||||
|
||||
#else
|
||||
static inline int
|
||||
spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
|
||||
@@ -334,6 +337,12 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline
|
||||
bool spi_mem_dtr_supports_op(struct spi_mem *mem,
|
||||
const struct spi_mem_op *op)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_SPI_MEM */
|
||||
|
||||
int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
|
||||
|
@@ -61,7 +61,8 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 dma_mask,
|
||||
*phys_limit = dma_to_phys(dev, dma_limit);
|
||||
if (*phys_limit <= DMA_BIT_MASK(zone_dma_bits))
|
||||
return GFP_DMA;
|
||||
if (*phys_limit <= DMA_BIT_MASK(32))
|
||||
if (*phys_limit <= DMA_BIT_MASK(32) &&
|
||||
!zone_dma32_is_empty(dev_to_node(dev)))
|
||||
return GFP_DMA32;
|
||||
return 0;
|
||||
}
|
||||
@@ -101,7 +102,8 @@ again:
|
||||
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
|
||||
phys_limit < DMA_BIT_MASK(64) &&
|
||||
!(gfp & (GFP_DMA32 | GFP_DMA))) {
|
||||
!(gfp & (GFP_DMA32 | GFP_DMA)) &&
|
||||
!zone_dma32_is_empty(node)) {
|
||||
gfp |= GFP_DMA32;
|
||||
goto again;
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ static bool cma_in_zone(gfp_t gfp)
|
||||
end = cma_get_base(cma) + size - 1;
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA))
|
||||
return end <= DMA_BIT_MASK(zone_dma_bits);
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32))
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32) && !zone_dma32_are_empty())
|
||||
return end <= DMA_BIT_MASK(32);
|
||||
return true;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ static void atomic_pool_work_fn(struct work_struct *work)
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA))
|
||||
atomic_pool_resize(atomic_pool_dma,
|
||||
GFP_KERNEL | GFP_DMA);
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32))
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && !zone_dma32_are_empty())
|
||||
atomic_pool_resize(atomic_pool_dma32,
|
||||
GFP_KERNEL | GFP_DMA32);
|
||||
atomic_pool_resize(atomic_pool_kernel, GFP_KERNEL);
|
||||
@@ -212,7 +212,7 @@ static int __init dma_atomic_pool_init(void)
|
||||
if (!atomic_pool_dma)
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32)) {
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && !zone_dma32_are_empty()) {
|
||||
atomic_pool_dma32 = __dma_atomic_pool_init(atomic_pool_size,
|
||||
GFP_KERNEL | GFP_DMA32);
|
||||
if (!atomic_pool_dma32)
|
||||
@@ -227,7 +227,7 @@ postcore_initcall(dma_atomic_pool_init);
|
||||
static inline struct gen_pool *dma_guess_pool(struct gen_pool *prev, gfp_t gfp)
|
||||
{
|
||||
if (prev == NULL) {
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32))
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32) && !zone_dma32_are_empty())
|
||||
return atomic_pool_dma32;
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA))
|
||||
return atomic_pool_dma;
|
||||
|
Reference in New Issue
Block a user