Skip to content

Commit ca09e2a

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: Intel: pci-tng: revert invalid bar size setting
The logic for the ioremap is to find the resource index 3 (IRAM) and infer the BAR address by subtracting the IRAM offset. The BAR size defined in hardware specifications is 2MB. The commit 5947b27 ("ASoC: SOF: Intel: Check the bar size before remapping") tried to find the BAR size by querying the resource length instead of a pre-canned value, but by requesting the size for index 3 it only gets the size of the IRAM. That's obviously wrong and prevents the probe from proceeding. This commit attempted to fix an issue in a fuzzing/simulated environment but created another on actual devices, so the best course of action is to revert that change. Reported-by: Ferry Toth <[email protected]> Tested-by: Ferry Toth <[email protected]> (Intel Edison-Arduino) Link: thesofproject#3901 Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6ba8ddf commit ca09e2a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sound/soc/sof/intel/pci-tng.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ static int tangier_pci_probe(struct snd_sof_dev *sdev)
7575

7676
/* LPE base */
7777
base = pci_resource_start(pci, desc->resindex_lpe_base) - IRAM_OFFSET;
78-
size = pci_resource_len(pci, desc->resindex_lpe_base);
79-
if (size < PCI_BAR_SIZE) {
80-
dev_err(sdev->dev, "error: I/O region is too small.\n");
81-
return -ENODEV;
82-
}
78+
size = PCI_BAR_SIZE;
8379

8480
dev_dbg(sdev->dev, "LPE PHY base at 0x%x size 0x%x", base, size);
8581
sdev->bar[DSP_BAR] = devm_ioremap(sdev->dev, base, size);

0 commit comments

Comments
 (0)