Re: x86/dma conversion for v4.17-rc1 breaks sound / sst-acpi (commit 6e4bf5867783)
On Fri, Apr 06, 2018 at 02:14:18AM +0100, Mark Brown wrote: > On Thu, Apr 05, 2018 at 10:56:57PM +0200, Dominik Brodowski wrote: > > Christoph, > > > > unfortunately, commit 6e4bf5867783 breaks sound on my Dell XPS13, see the > > dmesg diff between fec777c385b6 and 6e4bf5867783: > > Adding Vinod and Pierre from Intel in case they have any ideas here. > Which model of XPS13 is this (2015?)? Dell Inc. XPS 13 9343/0TM99H, BIOS A11 12/08/2016, with # CONFIG_GPIOLIB is not set, just CONFIG_PINCTRL=y but no # CONFIG_PINCTRL_BAYTRAIL is not set # CONFIG_PINCTRL_CHERRYVIEW is not set # CONFIG_PINCTRL_BROXTON is not set # CONFIG_PINCTRL_CANNONLAKE is not set # CONFIG_PINCTRL_CEDARFORK is not set # CONFIG_PINCTRL_DENVERTON is not set # CONFIG_PINCTRL_GEMINILAKE is not set # CONFIG_PINCTRL_LEWISBURG is not set # CONFIG_PINCTRL_SUNRISEPOINT is not set (yes, this works, see commit d1fa74520dcd ), and, CONFIG_SND_HDA_I915=y CONFIG_SND_SOC=y CONFIG_SND_SOC_AC97_BUS=y CONFIG_SND_SOC_COMPRESS=y CONFIG_SND_SOC_ACPI=y CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y CONFIG_SND_SST_IPC=y CONFIG_SND_SST_IPC_ACPI=y CONFIG_SND_SOC_INTEL_SST_ACPI=y CONFIG_SND_SOC_INTEL_SST=y CONFIG_SND_SOC_INTEL_SST_FIRMWARE=y CONFIG_SND_SOC_INTEL_HASWELL=y CONFIG_SND_SST_ATOM_HIFI2_PLATFORM=y CONFIG_SND_SOC_ACPI_INTEL_MATCH=y CONFIG_SND_SOC_INTEL_MACH=y CONFIG_SND_SOC_INTEL_BROADWELL_MACH=y CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH=y CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH=y CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH=y CONFIG_SND_SOC_I2C_AND_SPI=y CONFIG_SND_SOC_AC97_CODEC=y Thanks for looking into this! Dominik > > -sst-acpi INT3438:00: DesignWare DMA Controller, 8 channels > > -haswell-pcm-audio haswell-pcm-audio: Direct firmware load for > > intel/IntcPP01.bin failed with error -2 > > -haswell-pcm-audio haswell-pcm-audio: fw image intel/IntcPP01.bin not > > available(-2) > > -haswell-pcm-audio haswell-pcm-audio: FW loaded, mailbox readback FW info: > > type 01, - version: 00.00, build 77, source commit id: > > 876ac6906f31a43b6772b23c7c983ce9dcb18a19 > > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping > > ok > > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin > > mapping ok > > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin > > mapping ok > > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin > > mapping ok > > -broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping > > ok > > -input: broadwell-rt286 Headset as > > /devices/pci:00/INT3438:00/broadwell-audio/sound/card1/input15 > > +broadwell-audio broadwell-audio: ASoC: CPU DAI System Pin not registered > > > So it seems that sst-acpi is unhappy with this patch. Any ideas? ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: x86/dma conversion for v4.17-rc1 breaks sound / sst-acpi (commit 6e4bf5867783)
On Thu, Apr 05, 2018 at 10:56:57PM +0200, Dominik Brodowski wrote: > Christoph, > > unfortunately, commit 6e4bf5867783 breaks sound on my Dell XPS13, see the > dmesg diff between fec777c385b6 and 6e4bf5867783: Adding Vinod and Pierre from Intel in case they have any ideas here. Which model of XPS13 is this (2015?)? > -sst-acpi INT3438:00: DesignWare DMA Controller, 8 channels > -haswell-pcm-audio haswell-pcm-audio: Direct firmware load for > intel/IntcPP01.bin failed with error -2 > -haswell-pcm-audio haswell-pcm-audio: fw image intel/IntcPP01.bin not > available(-2) > -haswell-pcm-audio haswell-pcm-audio: FW loaded, mailbox readback FW info: > type 01, - version: 00.00, build 77, source commit id: > 876ac6906f31a43b6772b23c7c983ce9dcb18a19 > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping > ok > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping > ok > -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping > ok > -broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok > -input: broadwell-rt286 Headset as > /devices/pci:00/INT3438:00/broadwell-audio/sound/card1/input15 > +broadwell-audio broadwell-audio: ASoC: CPU DAI System Pin not registered > So it seems that sst-acpi is unhappy with this patch. Any ideas? > Thanks, > Dominik signature.asc Description: PGP signature ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: x86/dma conversion for v4.17-rc1 breaks sound / sst-acpi (commit 6e4bf5867783)
On Thu, Apr 05, 2018 at 10:56:57PM +0200, Dominik Brodowski wrote: > Christoph, > > unfortunately, commit 6e4bf5867783 breaks sound on my Dell XPS13, see the > dmesg diff between fec777c385b6 and 6e4bf5867783: Very strange. I'll need to spend some time untangling all that sound-soc mess where it might be stuck. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
x86/dma conversion for v4.17-rc1 breaks sound / sst-acpi (commit 6e4bf5867783)
Christoph, unfortunately, commit 6e4bf5867783 breaks sound on my Dell XPS13, see the dmesg diff between fec777c385b6 and 6e4bf5867783: -sst-acpi INT3438:00: DesignWare DMA Controller, 8 channels -haswell-pcm-audio haswell-pcm-audio: Direct firmware load for intel/IntcPP01.bin failed with error -2 -haswell-pcm-audio haswell-pcm-audio: fw image intel/IntcPP01.bin not available(-2) -haswell-pcm-audio haswell-pcm-audio: FW loaded, mailbox readback FW info: type 01, - version: 00.00, build 77, source commit id: 876ac6906f31a43b6772b23c7c983ce9dcb18a19 -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> System Pin mapping ok -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload0 Pin mapping ok -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Offload1 Pin mapping ok -broadwell-audio broadwell-audio: snd-soc-dummy-dai <-> Loopback Pin mapping ok -broadwell-audio broadwell-audio: rt286-aif1 <-> snd-soc-dummy-dai mapping ok -input: broadwell-rt286 Headset as /devices/pci:00/INT3438:00/broadwell-audio/sound/card1/input15 +broadwell-audio broadwell-audio: ASoC: CPU DAI System Pin not registered So it seems that sst-acpi is unhappy with this patch. Any ideas? Thanks, Dominik ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH v2 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU
On 4/4/2018 1:55 PM, Gary R Hook wrote: > Implement a skeleton framework for debugfs support in the > AMD IOMMU. > > > Signed-off-by: Gary R Hook > --- > drivers/iommu/Makefile|1 + > drivers/iommu/amd_iommu_debugfs.c | 45 > + > drivers/iommu/amd_iommu_init.c|7 -- > drivers/iommu/amd_iommu_proto.h |8 ++- > drivers/iommu/amd_iommu_types.h |3 ++ > 5 files changed, 61 insertions(+), 3 deletions(-) > create mode 100644 drivers/iommu/amd_iommu_debugfs.c > > diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile > index 5eb1121d54b9..0ca250f626d9 100644 > --- a/drivers/iommu/Makefile > +++ b/drivers/iommu/Makefile > @@ -11,6 +11,7 @@ obj-$(CONFIG_IOMMU_IOVA) += iova.o > obj-$(CONFIG_OF_IOMMU) += of_iommu.o > obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o > obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o amd_iommu_init.o > +obj-$(CONFIG_IOMMU_DEBUG) += amd_iommu_debugfs.o > obj-$(CONFIG_AMD_IOMMU_V2) += amd_iommu_v2.o > obj-$(CONFIG_ARM_SMMU) += arm-smmu.o > obj-$(CONFIG_ARM_SMMU_V3) += arm-smmu-v3.o > diff --git a/drivers/iommu/amd_iommu_debugfs.c > b/drivers/iommu/amd_iommu_debugfs.c > new file mode 100644 > index ..282100a655b3 > --- /dev/null > +++ b/drivers/iommu/amd_iommu_debugfs.c > @@ -0,0 +1,45 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * AMD IOMMU driver > + * > + * Copyright (C) 2018 Advanced Micro Devices, Inc. > + * > + * Author: Gary R Hook > + */ > + > +#include > +#include > +#include > +#include "amd_iommu_proto.h" > +#include "amd_iommu_types.h" > + > +static struct dentry *amd_iommu_debugfs; > +static DEFINE_MUTEX(amd_iommu_debugfs_lock); > + > +#define MAX_NAME_LEN20 > + > +void amd_iommu_debugfs_setup(struct amd_iommu *iommu) > +{ > + char name[MAX_NAME_LEN + 1]; > + struct dentry *d_top; > + > + if (!debugfs_initialized()) > + return; > + > + mutex_lock(&amd_iommu_debugfs_lock); > + if (!amd_iommu_debugfs) { > + d_top = iommu_debugfs_setup(); > + if (d_top) > + amd_iommu_debugfs = debugfs_create_dir("amd", d_top); > + } > + mutex_unlock(&amd_iommu_debugfs_lock); > + if (amd_iommu_debugfs) { > + snprintf(name, MAX_NAME_LEN, "iommu%02d", iommu->index); > + iommu->debugfs = debugfs_create_dir(name, > + amd_iommu_debugfs); > + if (!iommu->debugfs) { > + debugfs_remove_recursive(amd_iommu_debugfs); > + amd_iommu_debugfs = NULL; > + } > + } > +} > diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c > index 6fe2d0346073..43856c7f4ea1 100644 > --- a/drivers/iommu/amd_iommu_init.c > +++ b/drivers/iommu/amd_iommu_init.c > @@ -89,6 +89,7 @@ > #define ACPI_DEVFLAG_ATSDIS 0x1000 > > #define LOOP_TIMEOUT 10 > + Spurious new line. > /* > * ACPI table definitions > * > @@ -2720,6 +2721,7 @@ int __init amd_iommu_enable_faulting(void) > */ > static int __init amd_iommu_init(void) > { > + struct amd_iommu *iommu; > int ret; > > ret = iommu_go_to_state(IOMMU_INITIALIZED); > @@ -2729,14 +2731,15 @@ static int __init amd_iommu_init(void) > disable_iommus(); > free_iommu_resources(); > } else { > - struct amd_iommu *iommu; > - > uninit_device_table_dma(); > for_each_iommu(iommu) > iommu_flush_all_caches(iommu); > } > } > > + for_each_iommu(iommu) > + amd_iommu_debugfs_setup(iommu); > + > return ret; > } > > diff --git a/drivers/iommu/amd_iommu_proto.h b/drivers/iommu/amd_iommu_proto.h > index 640c286a0ab9..1cfaae28c2cd 100644 > --- a/drivers/iommu/amd_iommu_proto.h > +++ b/drivers/iommu/amd_iommu_proto.h > @@ -33,6 +33,12 @@ extern void amd_iommu_uninit_devices(void); > extern void amd_iommu_init_notifier(void); > extern int amd_iommu_init_api(void); > > +#ifdef CONFIG_IOMMU_DEBUG > +void amd_iommu_debugfs_setup(struct amd_iommu *iommu); > +#else > +static inline void amd_iommu_debugfs_setup(struct amd_iommu *iommu) {} > +#endif > + > /* Needed for interrupt remapping */ > extern int amd_iommu_prepare(void); > extern int amd_iommu_enable(void); > @@ -58,7 +64,7 @@ extern int amd_iommu_domain_clear_gcr3(struct iommu_domain > *dom, int pasid); > extern struct iommu_domain *amd_iommu_get_v2_domain(struct pci_dev *pdev); > > #ifdef CONFIG_IRQ_REMAP > -extern int amd_iommu_create_irq_domain(struct amd_iommu *iommu); > +int amd_iommu_create_irq_domain(struct amd_iommu *iommu); I don't think this change is required for the debugfs support. Thanks, Tom > #else > static inline int amd_iommu_create_irq_domain(struct amd_iommu *iommu) > { > diff --git a/drivers/iommu/amd_iommu_types.h
Re: [PATCH v2 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU
Hi Gary, Thank you for the patch! Yet something to improve: [auto build test ERROR on iommu/next] [also build test ERROR on v4.16 next-20180405] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Gary-R-Hook/iommu-Enable-debugfs-exposure-of-the-IOMMU/20180405-151608 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next config: x86_64-randconfig-s2-04060234 (attached as .config) compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers//iommu/amd_iommu_debugfs.c: In function 'amd_iommu_debugfs_setup': >> drivers//iommu/amd_iommu_debugfs.c:31:11: error: implicit declaration of >> function 'iommu_debugfs_setup' [-Werror=implicit-function-declaration] d_top = iommu_debugfs_setup(); ^~~ drivers//iommu/amd_iommu_debugfs.c:31:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion] d_top = iommu_debugfs_setup(); ^ cc1: some warnings being treated as errors vim +/iommu_debugfs_setup +31 drivers//iommu/amd_iommu_debugfs.c 20 21 void amd_iommu_debugfs_setup(struct amd_iommu *iommu) 22 { 23 char name[MAX_NAME_LEN + 1]; 24 struct dentry *d_top; 25 26 if (!debugfs_initialized()) 27 return; 28 29 mutex_lock(&amd_iommu_debugfs_lock); 30 if (!amd_iommu_debugfs) { > 31 d_top = iommu_debugfs_setup(); --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
amd_iommu fallback question
Hi Joerg, I've got a little question on the amd_iommu code, hope you (or someone else on the list) can answer it. Most of the dma_map_ops methods have a fallback for the case when get_domain() return -EINVAL, which basically duplicates the normal no-iommu implementation, with the map_sg method being and exception that always returns and error (return value of 0 is an error for its calling convention). Is that an oversight? If yes so I wonder why it hasn't been caught yet. Or is the whole fallback code dead and can be removed? ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH] iommu/arm-smmu-v3: Set GBPA to abort all transactions
On Wed, Mar 28, 2018 at 09:39:40AM -0500, Timur Tabi wrote: > From: Sameer Goel > > Set SMMU_GBPA to abort all incoming translations during the SMMU reset > when SMMUEN==0. > > This prevents a race condition where a stray DMA from the crashed primary > kernel can try to access an IOVA address as an invalid PA when SMMU is > disabled during reset in the crash kernel. > > Signed-off-by: Sameer Goel > --- > drivers/iommu/arm-smmu-v3.c | 12 > 1 file changed, 12 insertions(+) > > diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c > index 3f2f1fc68b52..c04a89310c59 100644 > --- a/drivers/iommu/arm-smmu-v3.c > +++ b/drivers/iommu/arm-smmu-v3.c > @@ -2458,6 +2458,18 @@ static int arm_smmu_device_reset(struct > arm_smmu_device *smmu, bool bypass) > if (reg & CR0_SMMUEN) > dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n"); > > + /* > + * Abort all incoming translations. This can happen in a kdump case > + * where SMMU is initialized when a prior DMA is pending. Just > + * disabling the SMMU in this case might result in writes to invalid > + * PAs. > + */ > + ret = arm_smmu_update_gbpa(smmu, 1, GBPA_ABORT); > + if (ret) { > + dev_err(smmu->dev, "GBPA not responding to update\n"); > + return ret; > + } This needs to be predicated on the disable_bypass option, otherwise I think it will cause regressions for systems that rely on passthrough. Will ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH] swiotlb: remove an unecessary NULL check
Smatch complains here: lib/swiotlb.c:730 swiotlb_alloc_buffer() warn: variable dereferenced before check 'dev' (see line 716) "dev" isn't ever NULL in this function so we can just remove the check. Signed-off-by: Dan Carpenter diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 47aeb04c1997..51dde88e50a3 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -727,7 +727,7 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle, out_unmap: dev_warn(dev, "hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", - (unsigned long long)(dev ? dev->coherent_dma_mask : 0), + (unsigned long long)dev->coherent_dma_mask, (unsigned long long)*dma_handle); /* ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[GIT PULL] dma-mapping updates for 4.17
Very light this round as the interesting dma mapping changes went through the x86 tree: The following changes since commit 0c8efd610b58cb23cefdfa12015799079aef94ae: Linux 4.16-rc5 (2018-03-11 17:25:09 -0700) are available in the Git repository at: git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-4.17 for you to fetch changes up to 1f674e16f9ce6eb20ee2e81ae7514737376874de: usb: gadget: Add NO_DMA dummies for DMA mapping API (2018-03-16 19:58:28 +0100) dma-mapping updates for 4.17: - provide proper stubs for architectures not supporting dma (Geert) Geert Uytterhoeven (5): dma-mapping: Convert NO_DMA get_dma_ops() into a real dummy dma-coherent: Add NO_DMA dummies for managed DMA API mm: Add NO_DMA dummies for DMA pool API scsi: Add NO_DMA dummies for SCSI DMA mapping API usb: gadget: Add NO_DMA dummies for DMA mapping API include/linux/dma-mapping.h | 19 ++- include/linux/dmapool.h | 30 +++--- include/linux/usb/gadget.h | 12 include/scsi/scsi_cmnd.h| 5 + 4 files changed, 54 insertions(+), 12 deletions(-) ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH v2 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU
Hi Gary, Thank you for the patch! Yet something to improve: [auto build test ERROR on iommu/next] [also build test ERROR on v4.16 next-20180404] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Gary-R-Hook/iommu-Enable-debugfs-exposure-of-the-IOMMU/20180405-151608 base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next config: x86_64-randconfig-x002-201813 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): drivers//iommu/amd_iommu_debugfs.c: In function 'amd_iommu_debugfs_setup': >> drivers//iommu/amd_iommu_debugfs.c:31:11: error: implicit declaration of >> function 'iommu_debugfs_setup'; did you mean 'amd_iommu_debugfs_setup'? >> [-Werror=implicit-function-declaration] d_top = iommu_debugfs_setup(); ^~~ amd_iommu_debugfs_setup >> drivers//iommu/amd_iommu_debugfs.c:31:9: warning: assignment makes pointer >> from integer without a cast [-Wint-conversion] d_top = iommu_debugfs_setup(); ^ cc1: some warnings being treated as errors vim +31 drivers//iommu/amd_iommu_debugfs.c 20 21 void amd_iommu_debugfs_setup(struct amd_iommu *iommu) 22 { 23 char name[MAX_NAME_LEN + 1]; 24 struct dentry *d_top; 25 26 if (!debugfs_initialized()) 27 return; 28 29 mutex_lock(&amd_iommu_debugfs_lock); 30 if (!amd_iommu_debugfs) { > 31 d_top = iommu_debugfs_setup(); --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu