Skip to content

Commit 66f7999

Browse files
committed
Merge branch 'bits/030-misc' into asahi-wip
2 parents 3f1d3ee + 87c07c3 commit 66f7999

20 files changed

Lines changed: 204 additions & 53 deletions

File tree

arch/arm64/include/asm/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112

113113
#define DIRECT_MAP_PHYSMEM_END __pa(PAGE_END - 1)
114114

115-
#define MIN_THREAD_SHIFT (14 + KASAN_THREAD_SHIFT)
115+
#define MIN_THREAD_SHIFT (15 + KASAN_THREAD_SHIFT)
116116

117117
/*
118118
* VMAP'd stacks are allocated at page granularity, so we must ensure that such

drivers/base/core.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,32 @@ static void fw_devlink_link_device(struct device *dev)
23312331
__fw_devlink_link_to_suppliers(dev, fwnode);
23322332
}
23332333

2334+
/**
2335+
* fw_devlink_count_absent_consumers - Return how many consumers have
2336+
* either not been created yet, or do not yet have a driver attached.
2337+
* @fwnode: fwnode of the supplier
2338+
*/
2339+
int fw_devlink_count_absent_consumers(struct fwnode_handle *fwnode)
2340+
{
2341+
struct fwnode_link *link, *tmp;
2342+
struct device_link *dlink, *dtmp;
2343+
struct device *sup_dev = get_dev_from_fwnode(fwnode);
2344+
int count = 0;
2345+
2346+
list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook)
2347+
count++;
2348+
2349+
if (!sup_dev)
2350+
return count;
2351+
2352+
list_for_each_entry_safe(dlink, dtmp, &sup_dev->links.consumers, s_node)
2353+
if (dlink->consumer->links.status != DL_DEV_DRIVER_BOUND)
2354+
count++;
2355+
2356+
return count;
2357+
}
2358+
EXPORT_SYMBOL_GPL(fw_devlink_count_absent_consumers);
2359+
23342360
/* Device links support end. */
23352361

23362362
static struct kobject *dev_kobj;

drivers/base/firmware_loader/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ static int fw_decompress_xz(struct device *dev, struct fw_priv *fw_priv,
471471
static char fw_path_para[256];
472472
static const char * const fw_path[] = {
473473
fw_path_para,
474+
"/lib/firmware/vendor/" UTS_RELEASE,
475+
"/lib/firmware/vendor",
474476
"/lib/firmware/updates/" UTS_RELEASE,
475477
"/lib/firmware/updates",
476478
"/lib/firmware/" UTS_RELEASE,

drivers/gpu/drm/sysfb/simpledrm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,12 @@ static int simpledrm_probe(struct platform_device *pdev)
845845
struct drm_device *dev;
846846
int ret;
847847

848+
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
849+
if (ret)
850+
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
851+
if (ret)
852+
return dev_err_probe(&pdev->dev, ret, "Failed to set dma mask\n");
853+
848854
sdev = simpledrm_device_create(&simpledrm_driver, pdev);
849855
if (IS_ERR(sdev))
850856
return PTR_ERR(sdev);

drivers/mmc/core/core.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,10 +2269,11 @@ void mmc_rescan(struct work_struct *work)
22692269
* while initializing the legacy SD interface. Therefore, let's start
22702270
* with UHS-II for now.
22712271
*/
2272-
if (!mmc_attach_sd_uhs2(host)) {
2273-
mmc_release_host(host);
2274-
goto out;
2275-
}
2272+
if (host->caps2 & MMC_CAP2_SD_UHS2)
2273+
if (!mmc_attach_sd_uhs2(host)) {
2274+
mmc_release_host(host);
2275+
goto out;
2276+
}
22762277

22772278
for (i = 0; i < ARRAY_SIZE(freqs); i++) {
22782279
unsigned int freq = freqs[i];

drivers/mmc/host/sdhci-pci-core.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/debugfs.h>
2828
#include <linux/acpi.h>
2929
#include <linux/dmi.h>
30+
#include <linux/of.h>
3031

3132
#include <linux/mmc/host.h>
3233
#include <linux/mmc/mmc.h>
@@ -2129,6 +2130,7 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
21292130
struct sdhci_host *host;
21302131
int ret, bar = first_bar + slotno;
21312132
size_t priv_size = chip->fixes ? chip->fixes->priv_size : 0;
2133+
u32 cd_debounce_delay_ms;
21322134

21332135
if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
21342136
dev_err(&pdev->dev, "BAR %d is not iomem. Aborting.\n", bar);
@@ -2195,6 +2197,10 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
21952197
if (host->mmc->caps & MMC_CAP_CD_WAKE)
21962198
device_init_wakeup(&pdev->dev, true);
21972199

2200+
if (device_property_read_u32(&pdev->dev, "cd-debounce-delay-ms",
2201+
&cd_debounce_delay_ms))
2202+
cd_debounce_delay_ms = 200;
2203+
21982204
if (slot->cd_idx >= 0) {
21992205
struct gpiod_lookup_table *cd_gpio_lookup_table;
22002206

@@ -2213,14 +2219,24 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
22132219
ret = mmc_gpiod_request_cd(host->mmc, NULL,
22142220
slot->cd_idx,
22152221
slot->cd_override_level,
2216-
0);
2222+
cd_debounce_delay_ms * 1000);
22172223
if (ret == -EPROBE_DEFER)
22182224
goto remove;
22192225

22202226
if (ret) {
22212227
dev_warn(&pdev->dev, "failed to setup card detect gpio\n");
22222228
slot->cd_idx = -1;
22232229
}
2230+
} else if (is_of_node(pdev->dev.fwnode)) {
2231+
/* Allow all OF systems to use a CD GPIO if provided */
2232+
2233+
ret = mmc_gpiod_request_cd(host->mmc, "cd", 0,
2234+
slot->cd_override_level,
2235+
cd_debounce_delay_ms * 1000);
2236+
if (ret == -EPROBE_DEFER)
2237+
goto remove;
2238+
else if (ret == 0)
2239+
slot->cd_idx = 0;
22242240
}
22252241

22262242
if (chip->fixes && chip->fixes->add_host)

drivers/mmc/host/sdhci-pci-gli.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,8 @@ static const struct sdhci_ops sdhci_gl9755_ops = {
19711971

19721972
const struct sdhci_pci_fixes sdhci_gl9755 = {
19731973
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
1974-
.quirks2 = SDHCI_QUIRK2_BROKEN_DDR50,
1974+
// disable non-working UHS-II mode on apple silicon devices
1975+
.quirks2 = SDHCI_QUIRK2_BROKEN_DDR50 | SDHCI_QUIRK2_BROKEN_UHS2,
19751976
.probe_slot = gli_probe_slot_gl9755,
19761977
.add_host = sdhci_pci_uhs2_add_host,
19771978
.remove_host = sdhci_pci_uhs2_remove_host,

drivers/mmc/host/sdhci-uhs2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,8 @@ static void __sdhci_uhs2_add_host_v4(struct sdhci_host *host, u32 caps1)
11621162
mmc = host->mmc;
11631163

11641164
/* Support UHS2 */
1165-
if (caps1 & SDHCI_SUPPORT_UHS2)
1165+
if ((caps1 & SDHCI_SUPPORT_UHS2) &&
1166+
!(host->quirks2 & SDHCI_QUIRK2_BROKEN_UHS2))
11661167
mmc->caps2 |= MMC_CAP2_SD_UHS2;
11671168

11681169
max_current_caps2 = sdhci_readl(host, SDHCI_MAX_CURRENT_1);

drivers/mmc/host/sdhci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ struct sdhci_host {
537537
/* Issue CMD and DATA reset together */
538538
#define SDHCI_QUIRK2_ISSUE_CMD_DAT_RESET_TOGETHER (1<<19)
539539

540+
#define SDHCI_QUIRK2_BROKEN_UHS2 (1<<27)
541+
540542
int irq; /* Device IRQ */
541543
void __iomem *ioaddr; /* Mapped address */
542544
phys_addr_t mapbase; /* physical address base */

drivers/of/address.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,15 @@ static int of_bus_default_flags_match(struct device_node *np)
328328

329329
static int of_bus_default_match(struct device_node *np)
330330
{
331+
/**
332+
* To avoid issues with "missing" '#{address,size}-cells' properties
333+
* in dcp/dcpext nodes while evaluatting the 'piodma' sub device.
334+
* Keep this at least until v6.13 + 2 to ensure fixed devicetrees are
335+
* deployed.
336+
*/
337+
if (of_device_is_compatible(np, "apple,dcp") ||
338+
of_device_is_compatible(np, "apple,dcpext"))
339+
return true;
331340
/*
332341
* Check for presence first since of_bus_n_addr_cells() will warn when
333342
* walking parent nodes.
@@ -564,7 +573,7 @@ static u64 __of_translate_address(struct device_node *node,
564573
return OF_BAD_ADDR;
565574
pbus->count_cells(dev, &pna, &pns);
566575
if (!OF_CHECK_COUNTS(pna, pns)) {
567-
pr_err("Bad cell count for %pOF\n", dev);
576+
pr_debug("Bad cell count for %pOF\n", dev);
568577
return OF_BAD_ADDR;
569578
}
570579

0 commit comments

Comments
 (0)