[PATCH 1/3 V5] mmc:core: parse voltage from device-tree
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the available voltage mask. Signed-off-by: Haijun Zhang --- changes for v5: - add binding spec for this device node changes for v4: - Add new parameter mask to return voltages. .../devicetree/bindings/mmc/fsl-esdhc.txt | 4 ++ drivers/mmc/core/core.c| 44 ++ include/linux/mmc/core.h | 2 + 3 files changed, 50 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt index bd9be0b..b7943f3 100644 --- a/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt +++ b/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt @@ -19,6 +19,9 @@ Optional properties: "bus-width = <1>" property. - sdhci,auto-cmd12: specifies that a controller can only handle auto CMD12. + - voltage-ranges : two cells are required, first cell specifies minimum +slot voltage (mV), second cell specifies maximum slot voltage (mV). +Several ranges could be specified. Example: @@ -29,4 +32,5 @@ sdhci@2e000 { interrupt-parent = <&ipic>; /* Filled in by U-Boot */ clock-frequency = <0>; + voltage-ranges = <3300 3300>; }; diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 49a5bca..b9b9fb6 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -1196,6 +1197,49 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max) } EXPORT_SYMBOL(mmc_vddrange_to_ocrmask); +#ifdef CONFIG_OF + +/** + * mmc_of_parse_voltage - return mask of supported voltages + * @np: The device node need to be parsed. + * @mask: mask of voltages available for MMC/SD/SDIO + * + * 1. Return zero on success. + * 2. Return negative errno: voltage-range is invalid. + */ +int mmc_of_parse_voltage(struct device_node *np, u32 *mask) +{ + const u32 *voltage_ranges; + int num_ranges, i; + + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges); + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2; + if (!voltage_ranges || !num_ranges) { + pr_info("%s: voltage-ranges unspecified\n", np->full_name); + return -EINVAL; + } + + for (i = 0; i < num_ranges; i++) { + const int j = i * 2; + u32 ocr_mask; + + ocr_mask = mmc_vddrange_to_ocrmask( + be32_to_cpu(voltage_ranges[j]), + be32_to_cpu(voltage_ranges[j + 1])); + if (!ocr_mask) { + pr_err("%s: voltage-range #%d is invalid\n", + np->full_name, i); + return -EINVAL; + } + *mask |= ocr_mask; + } + + return 0; +} +EXPORT_SYMBOL(mmc_of_parse_voltage); + +#endif /* CONFIG_OF */ + #ifdef CONFIG_REGULATOR /** diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 443243b..da51bec 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -208,6 +208,8 @@ static inline void mmc_claim_host(struct mmc_host *host) __mmc_claim_host(host, NULL); } +struct device_node; extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); +extern int mmc_of_parse_voltage(struct device_node *np, u32 *mask); #endif /* LINUX_MMC_CORE_H */ -- 1.8.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
On Wed, Aug 14, 2013 at 01:30:17PM +0800, Nicolin Chen wrote: > Hi Shwan, > > On Wed, Aug 14, 2013 at 11:27:00AM +0800, Shawn Guo wrote: > > I do not think we need this general compatible string. Device tree > > compatible should be specific. > > So I should just use 'fsl,-spdif" and list all -spdif > in compatible list? > > I added 'fsl,fsl-spdif' just for those not-in-list chips, Vybrid > for example. So you think I should add all the possible chips to > the list? But what if some chip I don't know right now that also > uses this spdif controller? Add them to the list later? We only need to maintain those versions that require different programming model in the list. For example, if S/PDIF on Vybrid is completely compatible with imx6q one and uses the exactly same programming model, we do not need to maintain a compatible string for Vybrid S/PDIF at all. Instead, we only need to have something like below in Vybrid dts file, and S/PDIF driver will just work for it. compatible = "fsl,vf600-spdif", "fsl,imx6q-spdif"; Shawn ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
Hi Shwan, On Wed, Aug 14, 2013 at 11:27:00AM +0800, Shawn Guo wrote: > I do not think we need this general compatible string. Device tree > compatible should be specific. So I should just use 'fsl,-spdif" and list all -spdif in compatible list? I added 'fsl,fsl-spdif' just for those not-in-list chips, Vybrid for example. So you think I should add all the possible chips to the list? But what if some chip I don't know right now that also uses this spdif controller? Add them to the list later? Thank you. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Pull request: scottwood/linux.git next
On Thu, 2013-08-08 at 17:45 -0500, Scott Wood wrote: > powerpc/e500: Update compilation flags with core specific > options This breaks the build for my FSL test configs. For some reason gcc 4.7.3 doesn't know about -mcpu=e5500 Additionally, on 64-bit, that means one can no longer make a kernel that does both A2 and e5500... I'm reverting that crap patch, please make such optimizations CONFIG_* options like power5...7 Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH RESEND 4/8] net: fs_enet: remove unnecessary dev_set_drvdata()
unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index 8de53a1..7e3de10 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -1122,7 +1122,6 @@ static int fs_enet_remove(struct platform_device *ofdev) fep->ops->free_bd(ndev); fep->ops->cleanup_data(ndev); - dev_set_drvdata(fep->dev, NULL); of_node_put(fep->fpi->phy_node); free_netdev(ndev); return 0; -- 1.7.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH RESEND 2/8] net: ucc_geth: use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with &ofdev->dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen --- drivers/net/ethernet/freescale/ucc_geth.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 3c43dac..5930c39 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3911,14 +3911,12 @@ static int ucc_geth_probe(struct platform_device* ofdev) static int ucc_geth_remove(struct platform_device* ofdev) { - struct device *device = &ofdev->dev; - struct net_device *dev = dev_get_drvdata(device); + struct net_device *dev = platform_get_drvdata(ofdev); struct ucc_geth_private *ugeth = netdev_priv(dev); unregister_netdev(dev); free_netdev(dev); ucc_geth_memclean(ugeth); - dev_set_drvdata(device, NULL); return 0; } -- 1.7.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH RESEND 0/8] use platform_{get,set}_drvdata()
We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with &pdev->dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. changelog: this version add modify record about dev_set_drvdata(). Libo Chen (8): net: fsl_pq_mdio: use platform_{get,set}_drvdata() net: ucc_geth: use platform_{get,set}_drvdata() net: fec_mpc52xx_phy: use platform_{get,set}_drvdata() net: fs_enet: remove unnecessary dev_set_drvdata() net: sunbmac: use platform_{get,set}_drvdata() net: sunhme: use platform_{get,set}_drvdata() net: xilinx_emaclite: use platform_{get,set}_drvdata() net: davinci_mdio: use platform_{get,set}_drvdata() drivers/net/ethernet/freescale/fec_mpc52xx_phy.c |4 +--- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |1 - drivers/net/ethernet/freescale/fsl_pq_mdio.c |3 +-- drivers/net/ethernet/freescale/ucc_geth.c |4 +--- drivers/net/ethernet/sun/sunbmac.c |3 +-- drivers/net/ethernet/sun/sunhme.c |8 +++- drivers/net/ethernet/ti/davinci_mdio.c |4 +--- drivers/net/ethernet/xilinx/xilinx_emaclite.c |4 +--- 8 files changed, 9 insertions(+), 22 deletions(-) ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
On Tue, Aug 13, 2013 at 02:58:26PM -0300, Fabio Estevam wrote: > On Mon, Aug 12, 2013 at 9:01 AM, Nicolin Chen wrote: > > +Required properties: > > + > > + - compatible : Compatible list, contains "fsl,-spdif". Using > > general > > Can't we just use "fsl,fsl-spdif" instead? > > > + "fsl,fsl-spdif" will get the default SoC type -- imx6q-spdif. I do not think we need this general compatible string. Device tree compatible should be specific. Shawn ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
Hi Fabio, Thank you for the comments. On Tue, Aug 13, 2013 at 02:58:26PM -0300, Fabio Estevam wrote: > On Mon, Aug 12, 2013 at 9:01 AM, Nicolin Chen wrote: > > +Required properties: > > + > > + - compatible : Compatible list, contains "fsl,-spdif". Using > > general > > Can't we just use "fsl,fsl-spdif" instead? > > > + "fsl,fsl-spdif" will get the default SoC type -- imx6q-spdif. > > + > > I think this is not the usual approach we do with dt. > > > +static const struct of_device_id fsl_spdif_dt_ids[] = { > > + { .compatible = "fsl,fsl-spdif", }, > > Isn't only the first entry enough here? I just saw Mark's words as well. So I don't need to change this part right? But I'd like to add imx35 on it. > This MODULE_ALIAS name does not match the name you provided earlier: > > .name = "fsl-spdif-dai" > I'll fix it in v5. Best regards, Nicolin Chen ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 02/10] KVM: PPC: reserve a capability number for multitce support
On Thu, 2013-08-01 at 14:44 +1000, Alexey Kardashevskiy wrote: > This is to reserve a capablity number for upcoming support > of H_PUT_TCE_INDIRECT and H_STUFF_TCE pseries hypercalls > which support mulptiple DMA map/unmap operations per one call. Gleb, any chance you can put this (and the next one) into a tree to "lock in" the numbers ? I've been wanting to apply the whole series to powerpc-next, that's stuff has been simmering for way too long and is in a good enough shape imho, but I need the capabilities and ioctl numbers locked in your tree first. Cheers, Ben. > Signed-off-by: Alexey Kardashevskiy > --- > Changes: > 2013/07/16: > * changed the number > > Signed-off-by: Alexey Kardashevskiy > --- > include/uapi/linux/kvm.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > index acccd08..99c2533 100644 > --- a/include/uapi/linux/kvm.h > +++ b/include/uapi/linux/kvm.h > @@ -667,6 +667,7 @@ struct kvm_ppc_smmu_info { > #define KVM_CAP_PPC_RTAS 91 > #define KVM_CAP_IRQ_XICS 92 > #define KVM_CAP_ARM_EL1_32BIT 93 > +#define KVM_CAP_SPAPR_MULTITCE 94 > > #ifdef KVM_CAP_IRQ_ROUTING > ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On Tue, 2013-08-13 at 21:45 +0200, Rafael J. Wysocki wrote: > > I'd go for 1 above personally. Yuck no. Two functions with roughly the same name and the same purpose differing only by an underscore just because one can't take 5mn to reconcile the new one with the old one ? No way. Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On Tue, 2013-08-13 at 13:44 -0500, Rob Herring wrote: > It is up to Rafael if he is willing/able to rebase his tree, but I > would drop this series until this is sorted out. I think the new > common function should be and can be generalized to work for powerpc. > It would need to make reg property optional and pass in the device > node to the arch specific function. > > A short term solution would be just to make the function "#ifndef > CONFIG_PPC". Please, no ifdef's with different signatures. Let's agree on the prototype first (ie, thread output argument) and make the generic one weak. Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On Tue, 2013-08-13 at 19:29 +0100, Sudeep KarkadaNagesha wrote: > I don't understand completely the use of ibm,ppc-interrupt-server#s and > its implications on generic of_get_cpu_node implementation. > I see the PPC specific definition of of_get_cpu_node uses thread id only > in 2 instances. Based on that, I have tried to move all the other > instances to use generic definition. > > Let me know if the idea is correct. No. The device-tree historically only represents cores, not HW threads, so it makes sense to retrieve also the thread number corresponding to the CPU. However, the mechanism to represent HW threads in the device-tree is currently somewhat platform specific (the ibm,ppc-interrupt-server#s). So what you could do for now is: - Have a generic version that always returns 0 as the thread, which is weak - powerpc keeps its own implementation - Start a discussion on the bindings (if not already there) to define threads in a better way at which point the generic function can be updated. Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On Tue, 2013-08-13 at 16:40 +0100, Sudeep KarkadaNagesha wrote: > There seems to be conflict in the new function "of_get_cpu_node" added. > PowerPC also defines the same function name. Further microblaze and > openrisc declares it(can be removed) but doesn't define it. > To fix this: > 1. I can rename the newly added function to something different like >`of_get_cpunode` or > 2. If of_* namespace should be used by only OF/FDT and not by any >architecture specific code, then the arch specific version can be >renamed to some thing like arch_of_get_cpu_node. >Also most of the calls to arch specific function can be moved to >generic code. > > Let me know your thoughts. What is your new function about ? Does it perform the same job as the one in powerpc ? If yes, make sure you have the same signature and either copy the powerpc one over to a generic place or make the generic one weak if you don't want the powerpc thread counting logic. Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On Tuesday, August 13, 2013 01:44:23 PM Rob Herring wrote: > On Tue, Aug 13, 2013 at 10:40 AM, Sudeep KarkadaNagesha > wrote: > > Adding PowerPC list > > > > On 13/08/13 14:00, Rafael J. Wysocki wrote: > >> On Monday, August 12, 2013 02:27:47 PM Sudeep KarkadaNagesha wrote: > >>> The following changes since commit > >>> d4e4ab86bcba5a72779c43dc1459f71fea3d89c8: > >>> > >>> Linux 3.11-rc5 (2013-08-11 18:04:20 -0700) > >>> > >>> are available in the git repository at: > >>> > >>> git://linux-arm.org/linux-skn.git cpu_of_node > > [snip] > > >> All error/warnings: > >> > >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) > >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) > >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) > >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) > >> In file included from arch/powerpc/include/asm/kvm_para.h:26:0, from > >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, > >> from include/linux/kvm_host.h:30, from > >> arch/powerpc/kernel/asm-offsets.c:53: > >> include/linux/of.h:269:28: error: conflicting types for > >>'of_get_cpu_node' > >> extern struct device_node *of_get_cpu_node(int cpu); ^ In file > >> included from include/linux/of.h:139:0, from > >> arch/powerpc/include/asm/kvm_para.h:26, from > >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, > >> from include/linux/kvm_host.h:30, from > >> arch/powerpc/kernel/asm-offsets.c:53: > >> arch/powerpc/include/asm/prom.h:47:21: note: previous declaration > >> of 'of_get_cpu_node' was here > >> struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); > >> ^ make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 make[2]: > >> Target `__build' not remade because of errors. make[1]: *** > >> [prepare0] Error 2 make[1]: Target `prepare' not remade because of > >> errors. make: *** [sub-make] Error 2 > >> > > > > There seems to be conflict in the new function "of_get_cpu_node" added. > > PowerPC also defines the same function name. Further microblaze and > > openrisc declares it(can be removed) but doesn't define it. > > To fix this: > > 1. I can rename the newly added function to something different like > >`of_get_cpunode` or > > 2. If of_* namespace should be used by only OF/FDT and not by any > >architecture specific code, then the arch specific version can be > >renamed to some thing like arch_of_get_cpu_node. > >Also most of the calls to arch specific function can be moved to > >generic code. > > > > Let me know your thoughts. > > It is up to Rafael if he is willing/able to rebase his tree, but I > would drop this series until this is sorted out. Yeah, I've just done that. > I think the new common function should be and can be generalized to work for > powerpc. > It would need to make reg property optional and pass in the device > node to the arch specific function. > > A short term solution would be just to make the function "#ifndef CONFIG_PPC". I wouldn't do that, it's almost guaranteed to be messy going forward. I'd go for 1 above personally. Thanks, Rafael ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
On Tue, Aug 13, 2013 at 02:58:26PM -0300, Fabio Estevam wrote: > On Mon, Aug 12, 2013 at 9:01 AM, Nicolin Chen wrote: > > +Required properties: > > + - compatible : Compatible list, contains "fsl,-spdif". Using > > general > Can't we just use "fsl,fsl-spdif" instead? It's better to list the specific chips in the DT so that we can quirk if we need to later. signature.asc Description: Digital signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
On Tue, Aug 13, 2013 at 2:58 PM, Fabio Estevam wrote: > On Mon, Aug 12, 2013 at 9:01 AM, Nicolin Chen wrote: >> +Required properties: >> + >> + - compatible : Compatible list, contains "fsl,-spdif". Using general > > Can't we just use "fsl,fsl-spdif" instead? Or maybe "fsl,imx35-spdif", since mx35 was the first imx SoC with this spdif IP block. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On Tue, Aug 13, 2013 at 10:40 AM, Sudeep KarkadaNagesha wrote: > Adding PowerPC list > > On 13/08/13 14:00, Rafael J. Wysocki wrote: >> On Monday, August 12, 2013 02:27:47 PM Sudeep KarkadaNagesha wrote: >>> The following changes since commit >>> d4e4ab86bcba5a72779c43dc1459f71fea3d89c8: >>> >>> Linux 3.11-rc5 (2013-08-11 18:04:20 -0700) >>> >>> are available in the git repository at: >>> >>> git://linux-arm.org/linux-skn.git cpu_of_node [snip] >> All error/warnings: >> >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) >> In file included from arch/powerpc/include/asm/kvm_para.h:26:0, from >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, >> from include/linux/kvm_host.h:30, from >> arch/powerpc/kernel/asm-offsets.c:53: >> include/linux/of.h:269:28: error: conflicting types for >>'of_get_cpu_node' >> extern struct device_node *of_get_cpu_node(int cpu); ^ In file >> included from include/linux/of.h:139:0, from >> arch/powerpc/include/asm/kvm_para.h:26, from >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, >> from include/linux/kvm_host.h:30, from >> arch/powerpc/kernel/asm-offsets.c:53: >> arch/powerpc/include/asm/prom.h:47:21: note: previous declaration >> of 'of_get_cpu_node' was here >> struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); >> ^ make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 make[2]: >> Target `__build' not remade because of errors. make[1]: *** >> [prepare0] Error 2 make[1]: Target `prepare' not remade because of >> errors. make: *** [sub-make] Error 2 >> > > There seems to be conflict in the new function "of_get_cpu_node" added. > PowerPC also defines the same function name. Further microblaze and > openrisc declares it(can be removed) but doesn't define it. > To fix this: > 1. I can rename the newly added function to something different like >`of_get_cpunode` or > 2. If of_* namespace should be used by only OF/FDT and not by any >architecture specific code, then the arch specific version can be >renamed to some thing like arch_of_get_cpu_node. >Also most of the calls to arch specific function can be moved to >generic code. > > Let me know your thoughts. It is up to Rafael if he is willing/able to rebase his tree, but I would drop this series until this is sorted out. I think the new common function should be and can be generalized to work for powerpc. It would need to make reg property optional and pass in the device node to the arch specific function. A short term solution would be just to make the function "#ifndef CONFIG_PPC". Rob ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On 08/13/2013 05:40 PM, Sudeep KarkadaNagesha wrote: > Adding PowerPC list > > On 13/08/13 14:00, Rafael J. Wysocki wrote: >> On Monday, August 12, 2013 02:27:47 PM Sudeep KarkadaNagesha wrote: >>> The following changes since commit >>> d4e4ab86bcba5a72779c43dc1459f71fea3d89c8: >>> >>> Linux 3.11-rc5 (2013-08-11 18:04:20 -0700) >>> >>> are available in the git repository at: >>> >>> git://linux-arm.org/linux-skn.git cpu_of_node >>> >>> for you to fetch changes up to >>> 9e9e26dde91f22635c87d0e45f3938b5ded96f0d: >>> >>> cpufreq: pmac32-cpufreq: remove device tree parsing for cpu nodes >>> (2013-08-12 10:22:29 +0100) >>> >>> >>> Sudeep KarkadaNagesha (16): of: add support for retrieving cpu node >>> for a given logical cpu index ARM: DT/kernel: define ARM specific >>> arch_match_cpu_phys_id driver/core: cpu: initialize of_node in >>> cpu's device struture of/device: add helper to get cpu device node >>> from logical cpu index ARM: topology: remove hwid/MPIDR dependency >>> from cpu_capacity ARM: mvebu: remove device tree parsing for cpu >>> nodes drivers/bus: arm-cci: avoid parsing DT for cpu device nodes >>> cpufreq: imx6q-cpufreq: remove device tree parsing for cpu nodes >>> cpufreq: cpufreq-cpu0: remove device tree parsing for cpu nodes >>> cpufreq: highbank-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: spear-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: arm_big_little: remove device tree parsing for cpu >>> nodes cpufreq: maple-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: pmac64-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: pmac32-cpufreq: remove device tree parsing for cpu >>> nodes >>> >>> arch/arm/kernel/devtree.c | 5 + >>> arch/arm/kernel/topology.c | 61 >>> +++-- >>> arch/arm/mach-imx/mach-imx6q.c | 3 +-- >>> arch/arm/mach-mvebu/platsmp.c | 52 >>> >>> drivers/base/cpu.c | 2 ++ drivers/bus/arm-cci.c >>> | 28 +++- >>> drivers/cpufreq/arm_big_little_dt.c | 40 >>> ++-- >>> drivers/cpufreq/cpufreq-cpu0.c | 23 --- >>> drivers/cpufreq/highbank-cpufreq.c | 18 ++ >>> drivers/cpufreq/imx6q-cpufreq.c | 4 +--- >>> drivers/cpufreq/kirkwood-cpufreq.c | 8 +--- >>> drivers/cpufreq/maple-cpufreq.c | 23 +++ >>> drivers/cpufreq/pmac32-cpufreq.c| 5 +++-- >>> drivers/cpufreq/pmac64-cpufreq.c| 47 >>> +++ >>> drivers/cpufreq/spear-cpufreq.c | 4 ++-- drivers/of/base.c >>> | 73 >>> + >>> >>> > include/linux/cpu.h | 1 + >>> include/linux/of.h | 6 ++ >>> include/linux/of_device.h | 15 +++ 19 files >>> changed, 202 insertions(+), 216 deletions(-) >>> >>> >>> PS: This patch series is reviewed and acknowledged @ >>> >>> v1: https://lkml.org/lkml/2013/7/15/128 v2: >>> https://lkml.org/lkml/2013/7/17/341 v3: >>> https://lkml.org/lkml/2013/7/22/219 >> >> Pulled, thanks! >> > Hi Rob, Rafael, > > On 13/08/13 15:16, kbuild test robot wrote:> tree: > git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git > bleeding-edge >> head: 0d4bcb5dc7d3040c0ce7572ea30ab9e5d9455bfa commit: >> 7939ff8d991de2c0b15064e76ee549a6df5ae67f [151/204] of: add >> support for retrieving cpu node for a given logical cpu index >> config: make ARCH=powerpc allmodconfig >> >> All error/warnings: >> >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) >> In file included from arch/powerpc/include/asm/kvm_para.h:26:0, from >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, >> from include/linux/kvm_host.h:30, from >> arch/powerpc/kernel/asm-offsets.c:53: >> include/linux/of.h:269:28: error: conflicting types for >> 'of_get_cpu_node' >> extern struct device_node *of_get_cpu_node(int cpu); ^ In file >> included from include/linux/of.h:139:0, from >> arch/powerpc/include/asm/kvm_para.h:26, from >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, >> from include/linux/kvm_host.h:30, from >> arch/powerpc/kernel/asm-offsets.c:53: >> arch/powerpc/include/asm/prom.h:47:21: note: previous declaration >> of 'of_get_cpu_node' was here >> struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); >> ^ make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 make[2]: >> Target `__build' not remade be
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
On 13/08/13 16:40, Sudeep KarkadaNagesha wrote: > Adding PowerPC list > > On 13/08/13 14:00, Rafael J. Wysocki wrote: >> On Monday, August 12, 2013 02:27:47 PM Sudeep KarkadaNagesha wrote: >>> The following changes since commit >>> d4e4ab86bcba5a72779c43dc1459f71fea3d89c8: >>> >>> Linux 3.11-rc5 (2013-08-11 18:04:20 -0700) >>> >>> are available in the git repository at: >>> >>> git://linux-arm.org/linux-skn.git cpu_of_node >>> >>> for you to fetch changes up to >>> 9e9e26dde91f22635c87d0e45f3938b5ded96f0d: >>> >>> cpufreq: pmac32-cpufreq: remove device tree parsing for cpu nodes >>> (2013-08-12 10:22:29 +0100) >>> >>> >>> Sudeep KarkadaNagesha (16): of: add support for retrieving cpu node >>> for a given logical cpu index ARM: DT/kernel: define ARM specific >>> arch_match_cpu_phys_id driver/core: cpu: initialize of_node in >>> cpu's device struture of/device: add helper to get cpu device node >>> from logical cpu index ARM: topology: remove hwid/MPIDR dependency >>> from cpu_capacity ARM: mvebu: remove device tree parsing for cpu >>> nodes drivers/bus: arm-cci: avoid parsing DT for cpu device nodes >>> cpufreq: imx6q-cpufreq: remove device tree parsing for cpu nodes >>> cpufreq: cpufreq-cpu0: remove device tree parsing for cpu nodes >>> cpufreq: highbank-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: spear-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: arm_big_little: remove device tree parsing for cpu >>> nodes cpufreq: maple-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: pmac64-cpufreq: remove device tree parsing for cpu >>> nodes cpufreq: pmac32-cpufreq: remove device tree parsing for cpu >>> nodes >>> >>> arch/arm/kernel/devtree.c | 5 + >>> arch/arm/kernel/topology.c | 61 >>> +++-- >>> arch/arm/mach-imx/mach-imx6q.c | 3 +-- >>> arch/arm/mach-mvebu/platsmp.c | 52 >>> >>> drivers/base/cpu.c | 2 ++ drivers/bus/arm-cci.c >>> | 28 +++- >>> drivers/cpufreq/arm_big_little_dt.c | 40 >>> ++-- >>> drivers/cpufreq/cpufreq-cpu0.c | 23 --- >>> drivers/cpufreq/highbank-cpufreq.c | 18 ++ >>> drivers/cpufreq/imx6q-cpufreq.c | 4 +--- >>> drivers/cpufreq/kirkwood-cpufreq.c | 8 +--- >>> drivers/cpufreq/maple-cpufreq.c | 23 +++ >>> drivers/cpufreq/pmac32-cpufreq.c| 5 +++-- >>> drivers/cpufreq/pmac64-cpufreq.c| 47 >>> +++ >>> drivers/cpufreq/spear-cpufreq.c | 4 ++-- drivers/of/base.c >>> | 73 >>> + >>> >>> > include/linux/cpu.h | 1 + >>> include/linux/of.h | 6 ++ >>> include/linux/of_device.h | 15 +++ 19 files >>> changed, 202 insertions(+), 216 deletions(-) >>> >>> >>> PS: This patch series is reviewed and acknowledged @ >>> >>> v1: https://lkml.org/lkml/2013/7/15/128 v2: >>> https://lkml.org/lkml/2013/7/17/341 v3: >>> https://lkml.org/lkml/2013/7/22/219 >> >> Pulled, thanks! >> > Hi Rob, Rafael, > > On 13/08/13 15:16, kbuild test robot wrote:> tree: > git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git > bleeding-edge >> head: 0d4bcb5dc7d3040c0ce7572ea30ab9e5d9455bfa commit: >> 7939ff8d991de2c0b15064e76ee549a6df5ae67f [151/204] of: add >> support for retrieving cpu node for a given logical cpu index >> config: make ARCH=powerpc allmodconfig >> >> All error/warnings: >> >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) >> warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) >> selects FSL_LBC which has unmet direct dependencies (FSL_SOC) >> In file included from arch/powerpc/include/asm/kvm_para.h:26:0, from >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, >> from include/linux/kvm_host.h:30, from >> arch/powerpc/kernel/asm-offsets.c:53: >> include/linux/of.h:269:28: error: conflicting types for >> 'of_get_cpu_node' >> extern struct device_node *of_get_cpu_node(int cpu); ^ In file >> included from include/linux/of.h:139:0, from >> arch/powerpc/include/asm/kvm_para.h:26, from >> include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, >> from include/linux/kvm_host.h:30, from >> arch/powerpc/kernel/asm-offsets.c:53: >> arch/powerpc/include/asm/prom.h:47:21: note: previous declaration >> of 'of_get_cpu_node' was here >> struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); >> ^ make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 make[2]: >> Target `__build' not remade because
Re: [alsa-devel] [PATCH v4 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
On Mon, Aug 12, 2013 at 9:01 AM, Nicolin Chen wrote: > +Required properties: > + > + - compatible : Compatible list, contains "fsl,-spdif". Using general Can't we just use "fsl,fsl-spdif" instead? > + "fsl,fsl-spdif" will get the default SoC type -- imx6q-spdif. > + I think this is not the usual approach we do with dt. > +static const struct of_device_id fsl_spdif_dt_ids[] = { > + { .compatible = "fsl,fsl-spdif", }, Isn't only the first entry enough here? > + { .compatible = "fsl,imx6q-spdif", }, > + { .compatible = "fsl,imx6sl-spdif", }, > + { .compatible = "fsl,imx53-spdif", }, > + {} > +}; > +MODULE_DEVICE_TABLE(of, fsl_spdif_dt_ids); > + > +static struct platform_driver fsl_spdif_driver = { > + .driver = { > + .name = "fsl-spdif-dai", > + .owner = THIS_MODULE, > + .of_match_table = fsl_spdif_dt_ids, > + }, > + .probe = fsl_spdif_probe, > + .remove = fsl_spdif_remove, > +}; > + > +module_platform_driver(fsl_spdif_driver); > + > +MODULE_AUTHOR("Freescale Semiconductor, Inc."); > +MODULE_DESCRIPTION("Freescale S/PDIF CPU DAI Driver"); > +MODULE_LICENSE("GPL v2"); > +MODULE_ALIAS("platform:fsl_spdif"); This MODULE_ALIAS name does not match the name you provided earlier: .name = "fsl-spdif-dai" ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [GIT PULL] DT/core: cpu_ofnode updates for v3.12
Adding PowerPC list On 13/08/13 14:00, Rafael J. Wysocki wrote: > On Monday, August 12, 2013 02:27:47 PM Sudeep KarkadaNagesha wrote: >> The following changes since commit >> d4e4ab86bcba5a72779c43dc1459f71fea3d89c8: >> >> Linux 3.11-rc5 (2013-08-11 18:04:20 -0700) >> >> are available in the git repository at: >> >> git://linux-arm.org/linux-skn.git cpu_of_node >> >> for you to fetch changes up to >> 9e9e26dde91f22635c87d0e45f3938b5ded96f0d: >> >> cpufreq: pmac32-cpufreq: remove device tree parsing for cpu nodes >> (2013-08-12 10:22:29 +0100) >> >> >> Sudeep KarkadaNagesha (16): of: add support for retrieving cpu node >> for a given logical cpu index ARM: DT/kernel: define ARM specific >> arch_match_cpu_phys_id driver/core: cpu: initialize of_node in >> cpu's device struture of/device: add helper to get cpu device node >> from logical cpu index ARM: topology: remove hwid/MPIDR dependency >> from cpu_capacity ARM: mvebu: remove device tree parsing for cpu >> nodes drivers/bus: arm-cci: avoid parsing DT for cpu device nodes >> cpufreq: imx6q-cpufreq: remove device tree parsing for cpu nodes >> cpufreq: cpufreq-cpu0: remove device tree parsing for cpu nodes >> cpufreq: highbank-cpufreq: remove device tree parsing for cpu >> nodes cpufreq: spear-cpufreq: remove device tree parsing for cpu >> nodes cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu >> nodes cpufreq: arm_big_little: remove device tree parsing for cpu >> nodes cpufreq: maple-cpufreq: remove device tree parsing for cpu >> nodes cpufreq: pmac64-cpufreq: remove device tree parsing for cpu >> nodes cpufreq: pmac32-cpufreq: remove device tree parsing for cpu >> nodes >> >> arch/arm/kernel/devtree.c | 5 + >> arch/arm/kernel/topology.c | 61 >> +++-- >> arch/arm/mach-imx/mach-imx6q.c | 3 +-- >> arch/arm/mach-mvebu/platsmp.c | 52 >> >> drivers/base/cpu.c | 2 ++ drivers/bus/arm-cci.c >> | 28 +++- >> drivers/cpufreq/arm_big_little_dt.c | 40 >> ++-- >> drivers/cpufreq/cpufreq-cpu0.c | 23 --- >> drivers/cpufreq/highbank-cpufreq.c | 18 ++ >> drivers/cpufreq/imx6q-cpufreq.c | 4 +--- >> drivers/cpufreq/kirkwood-cpufreq.c | 8 +--- >> drivers/cpufreq/maple-cpufreq.c | 23 +++ >> drivers/cpufreq/pmac32-cpufreq.c| 5 +++-- >> drivers/cpufreq/pmac64-cpufreq.c| 47 >> +++ >> drivers/cpufreq/spear-cpufreq.c | 4 ++-- drivers/of/base.c >> | 73 >> + >> >> include/linux/cpu.h | 1 + >> include/linux/of.h | 6 ++ >> include/linux/of_device.h | 15 +++ 19 files >> changed, 202 insertions(+), 216 deletions(-) >> >> >> PS: This patch series is reviewed and acknowledged @ >> >> v1: https://lkml.org/lkml/2013/7/15/128 v2: >> https://lkml.org/lkml/2013/7/17/341 v3: >> https://lkml.org/lkml/2013/7/22/219 > > Pulled, thanks! > Hi Rob, Rafael, On 13/08/13 15:16, kbuild test robot wrote:> tree: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge > head: 0d4bcb5dc7d3040c0ce7572ea30ab9e5d9455bfa commit: > 7939ff8d991de2c0b15064e76ee549a6df5ae67f [151/204] of: add > support for retrieving cpu node for a given logical cpu index > config: make ARCH=powerpc allmodconfig > > All error/warnings: > > warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) > selects FSL_LBC which has unmet direct dependencies (FSL_SOC) > warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) > selects FSL_LBC which has unmet direct dependencies (FSL_SOC) > In file included from arch/powerpc/include/asm/kvm_para.h:26:0, from > include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, > from include/linux/kvm_host.h:30, from > arch/powerpc/kernel/asm-offsets.c:53: > include/linux/of.h:269:28: error: conflicting types for >'of_get_cpu_node' > extern struct device_node *of_get_cpu_node(int cpu); ^ In file > included from include/linux/of.h:139:0, from > arch/powerpc/include/asm/kvm_para.h:26, from > include/uapi/linux/kvm_para.h:26, from include/linux/kvm_para.h:4, > from include/linux/kvm_host.h:30, from > arch/powerpc/kernel/asm-offsets.c:53: > arch/powerpc/include/asm/prom.h:47:21: note: previous declaration > of 'of_get_cpu_node' was here > struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); > ^ make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 make[2]: > Target `__build' not remade because of errors. make[1]: *** > [prepare0] Error 2 make[1]: Target `prepare' not remade because of > errors. make: *** [sub-make] Error 2 > There seems to
RE: Powerpc: Kernel warn_on when enabling IOMMU_API
> -Original Message- > From: Alexey Kardashevskiy [mailto:a...@ozlabs.ru] > Sent: Tuesday, August 13, 2013 6:25 PM > To: Bhushan Bharat-R65777 > Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org > Subject: Re: Powerpc: Kernel warn_on when enabling IOMMU_API > > On 08/13/2013 08:44 PM, Bhushan Bharat-R65777 wrote: > > > > > >> -Original Message- From: Alexey Kardashevskiy > >> [mailto:a...@ozlabs.ru] Sent: Tuesday, August 13, 2013 5:41 AM To: > >> Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; > >> linuxppc-dev@lists.ozlabs.org Subject: Re: Powerpc: Kernel warn_on > >> when enabling IOMMU_API > >> > >> On 08/13/2013 02:14 AM, Bhushan Bharat-R65777 wrote: > >>> > >>> > -Original Message- From: Alexey Kardashevskiy > [mailto:a...@ozlabs.ru] Sent: Monday, August 12, 2013 7:44 PM To: > Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; > linuxppc-dev@lists.ozlabs.org Subject: Re: Powerpc: Kernel warn_on > when enabling IOMMU_API > > On 08/12/2013 08:20 PM, Bhushan Bharat-R65777 wrote: > > And this simple fix work for me diff --git > > a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index > > b20ff17..8869b0d 100644 --- a/arch/powerpc/kernel/iommu.c > > +++ b/arch/powerpc/kernel/iommu.c @@ -48,6 +48,8 @@ #include > > #include > > > > +#define DEBUG + #define DBG(...) > > > > static int novmerge; @@ -871,7 +873,7 @@ void > > iommu_free_coherent(struct iommu_table *tbl, size_t > size, > > } } > > > > -#ifdef CONFIG_IOMMU_API +#ifdef SPAPR_TCE_IOMMU /* * SPAPR TCE > > API */ -- > > > And with this fix, what does "ls -laR /sys/kernel/iommu_groups/" > print? > >>> > >>> It shows the list of group id and respective devices: > >>> > >> > >> Is it vanilla 3.11-rc1 kernel? Wow. What does "lspci" show there? > > > > It is 3.11-rc1 + (FSL_IOMMU + VFIO-PCI : local changes). > > > > root@p5040ds:~# lspci > 00:00.0 Class 0604: 1957:0450 > 01:00.0 Class 0200: 8086:10fb > 00:00.0 Class 0604: 1957:0450 > 01:00.0 Class 0200: 8086:10d3 > > > Is it one PCI domain or two PCI domains? Hm. > > > We uses the bus_set_iommu(), generic iommu api, which creates a > > iommu_group for a device (drivers/iommu/iommu.c) using. Also this have > > notifier to support hotplug-able device. So when this initcall (in > > arch/powerpc/kernel/iommu.c) is called, iommu group is already setup > > for the device/s. > > > I think we do not need this piece of code for powerpc. So what is the > > best way to stub this out for FSL PowerPC/IOMMU? > > > So you implemented iommu_ops? Can you share your code somewhere, just to have > a > look? https://lkml.org/lkml/2013/7/1/158 > > > > Will the above #ifdef SPAPR_TCE_IOMMU work? Other way can be selecting > > iommu.c and dma-iommu.c in Makefile if SPAPR_TCE_IOMMU defined and not > > if CONFIG_64BIT. > > If SPAPR_TCE_IOMMU is enabled, the code would compile and the subsys_init > would > be called anyway, so normal production kernel will fail anyway. We will not enable this on FSL powerpc, -Bharat > > > > -- > Alexey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Powerpc: Kernel warn_on when enabling IOMMU_API
On 08/13/2013 08:44 PM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- From: Alexey Kardashevskiy >> [mailto:a...@ozlabs.ru] Sent: Tuesday, August 13, 2013 5:41 AM To: >> Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; >> linuxppc-dev@lists.ozlabs.org Subject: Re: Powerpc: Kernel warn_on >> when enabling IOMMU_API >> >> On 08/13/2013 02:14 AM, Bhushan Bharat-R65777 wrote: >>> >>> -Original Message- From: Alexey Kardashevskiy [mailto:a...@ozlabs.ru] Sent: Monday, August 12, 2013 7:44 PM To: Bhushan Bharat-R65777 Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org Subject: Re: Powerpc: Kernel warn_on when enabling IOMMU_API On 08/12/2013 08:20 PM, Bhushan Bharat-R65777 wrote: > And this simple fix work for me diff --git > a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c > index b20ff17..8869b0d 100644 --- a/arch/powerpc/kernel/iommu.c > +++ b/arch/powerpc/kernel/iommu.c @@ -48,6 +48,8 @@ #include > #include > > +#define DEBUG + #define DBG(...) > > static int novmerge; @@ -871,7 +873,7 @@ void > iommu_free_coherent(struct iommu_table *tbl, size_t size, > } } > > -#ifdef CONFIG_IOMMU_API +#ifdef SPAPR_TCE_IOMMU /* * SPAPR TCE > API */ -- And with this fix, what does "ls -laR /sys/kernel/iommu_groups/" print? >>> >>> It shows the list of group id and respective devices: >>> >> >> Is it vanilla 3.11-rc1 kernel? Wow. What does "lspci" show there? > > It is 3.11-rc1 + (FSL_IOMMU + VFIO-PCI : local changes). > > root@p5040ds:~# lspci 00:00.0 Class 0604: 1957:0450 01:00.0 Class 0200: 8086:10fb 00:00.0 Class 0604: 1957:0450 01:00.0 Class 0200: 8086:10d3 Is it one PCI domain or two PCI domains? Hm. > We uses the bus_set_iommu(), generic iommu api, which creates a > iommu_group for a device (drivers/iommu/iommu.c) using. Also this have > notifier to support hotplug-able device. So when this initcall (in > arch/powerpc/kernel/iommu.c) is called, iommu group is already setup for > the device/s. > I think we do not need this piece of code for powerpc. So what is the > best way to stub this out for FSL PowerPC/IOMMU? So you implemented iommu_ops? Can you share your code somewhere, just to have a look? > Will the above #ifdef SPAPR_TCE_IOMMU work? Other way can be selecting > iommu.c and dma-iommu.c in Makefile if SPAPR_TCE_IOMMU defined and not > if CONFIG_64BIT. If SPAPR_TCE_IOMMU is enabled, the code would compile and the subsys_init would be called anyway, so normal production kernel will fail anyway. -- Alexey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Powerpc: Kernel warn_on when enabling IOMMU_API
> -Original Message- > From: Alexey Kardashevskiy [mailto:a...@ozlabs.ru] > Sent: Tuesday, August 13, 2013 5:41 AM > To: Bhushan Bharat-R65777 > Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org > Subject: Re: Powerpc: Kernel warn_on when enabling IOMMU_API > > On 08/13/2013 02:14 AM, Bhushan Bharat-R65777 wrote: > > > > > >> -Original Message- > >> From: Alexey Kardashevskiy [mailto:a...@ozlabs.ru] > >> Sent: Monday, August 12, 2013 7:44 PM > >> To: Bhushan Bharat-R65777 > >> Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org > >> Subject: Re: Powerpc: Kernel warn_on when enabling IOMMU_API > >> > >> On 08/12/2013 08:20 PM, Bhushan Bharat-R65777 wrote: > >>> And this simple fix work for me > >>> diff --git a/arch/powerpc/kernel/iommu.c > >>> b/arch/powerpc/kernel/iommu.c index b20ff17..8869b0d 100644 > >>> --- a/arch/powerpc/kernel/iommu.c > >>> +++ b/arch/powerpc/kernel/iommu.c > >>> @@ -48,6 +48,8 @@ > >>> #include > >>> #include > >>> > >>> +#define DEBUG > >>> + > >>> #define DBG(...) > >>> > >>> static int novmerge; > >>> @@ -871,7 +873,7 @@ void iommu_free_coherent(struct iommu_table > >>> *tbl, size_t > >> size, > >>> } > >>> } > >>> > >>> -#ifdef CONFIG_IOMMU_API > >>> +#ifdef SPAPR_TCE_IOMMU > >>> /* > >>> * SPAPR TCE API > >>> */ > >>> -- > >> > >> > >> And with this fix, what does "ls -laR /sys/kernel/iommu_groups/" print? > > > > It shows the list of group id and respective devices: > > > > Is it vanilla 3.11-rc1 kernel? Wow. What does "lspci" show there? It is 3.11-rc1 + (FSL_IOMMU + VFIO-PCI : local changes). root@p5040ds:~# lspci 00:00.0 Class 0604: 1957:0450 01:00.0 Class 0200: 8086:10fb 00:00.0 Class 0604: 1957:0450 01:00.0 Class 0200: 8086:10d3 We uses the bus_set_iommu(), generic iommu api, which creates a iommu_group for a device (drivers/iommu/iommu.c) using. Also this have notifier to support hotplug-able device. So when this initcall (in arch/powerpc/kernel/iommu.c) is called, iommu group is already setup for the device/s. I think we do not need this piece of code for powerpc. So what is the best way to stub this out for FSL PowerPC/IOMMU? Will the above #ifdef SPAPR_TCE_IOMMU work? Other way can be selecting iommu.c and dma-iommu.c in Makefile if SPAPR_TCE_IOMMU defined and not if CONFIG_64BIT. -Bharat > > > -- > Alexey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev