* [PATCH 4/5 RFC] pci: msi: expose msi region information functions
From: Bharat Bhushan @ 2013-10-29 11:27 UTC (permalink / raw)
To: alex.williamson, joro, galak, scottwood, linux-kernel,
linuxppc-dev, linux-pci, agraf, stuart.yoder
Cc: Bharat Bhushan
In-Reply-To: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com>
So by now we have defined all the interfaces for getting the msi region,
this patch expose the interface to linux subsystem. These will be used by
vfio subsystem for setting up iommu for MSI interrupt of direct assignment
devices.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
include/linux/pci.h | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index da172f9..c587034 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1142,6 +1142,7 @@ struct msix_entry {
u16 entry; /* driver uses to specify entry, OS writes */
};
+struct msi_region;
#ifndef CONFIG_PCI_MSI
static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec)
@@ -1184,6 +1185,16 @@ static inline int pci_msi_enabled(void)
{
return 0;
}
+
+static inline int msi_get_region_count(void)
+{
+ return 0;
+}
+
+static inline int msi_get_region(int region_num, struct msi_region *region)
+{
+ return 0;
+}
#else
int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
@@ -1196,6 +1207,8 @@ void pci_disable_msix(struct pci_dev *dev);
void msi_remove_pci_irq_vectors(struct pci_dev *dev);
void pci_restore_msi_state(struct pci_dev *dev);
int pci_msi_enabled(void);
+int msi_get_region_count(void);
+int msi_get_region(int region_num, struct msi_region *region);
#endif
#ifdef CONFIG_PCIEPORTBUS
--
1.7.0.4
^ permalink raw reply related
* [PATCH 3/5 RFC] powerpc: msi: Extend the msi region interface to get info from fsl_msi
From: Bharat Bhushan @ 2013-10-29 11:27 UTC (permalink / raw)
To: alex.williamson, joro, galak, scottwood, linux-kernel,
linuxppc-dev, linux-pci, agraf, stuart.yoder
Cc: Bharat Bhushan
In-Reply-To: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com>
The FSL MSI will provide the interface to get:
- Number of MSI regions (which is number of MSI banks for powerpc)
- Get the region address range: Physical page which have the
address/addresses used for generating MSI interrupt
and size of the page.
These are required to create IOMMU (Freescale PAMU) mapping for
devices which are directly assigned using VFIO.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
arch/powerpc/sysdev/fsl_msi.c | 42 +++++++++++++++++++++++++++++++++++-----
arch/powerpc/sysdev/fsl_msi.h | 11 ++++++++-
2 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 77efbae..eeebbf0 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -109,6 +109,34 @@ static int fsl_msi_init_allocator(struct fsl_msi *msi_data)
return 0;
}
+static int fsl_msi_get_region_count(void)
+{
+ int count = 0;
+ struct fsl_msi *msi_data;
+
+ list_for_each_entry(msi_data, &msi_head, list)
+ count++;
+
+ return count;
+}
+
+static int fsl_msi_get_region(int region_num, struct msi_region *region)
+{
+ struct fsl_msi *msi_data;
+
+ list_for_each_entry(msi_data, &msi_head, list) {
+ if (msi_data->bank_index == region_num) {
+ region->region_num = msi_data->bank_index;
+ /* Setting PAGE_SIZE as MSIIR is a 4 byte register */
+ region->size = PAGE_SIZE;
+ region->addr = msi_data->msiir & ~(region->size - 1);
+ return 0;
+ }
+ }
+
+ return -ENODEV;
+}
+
static int fsl_msi_check_device(struct pci_dev *pdev, int nvec, int type)
{
if (type == PCI_CAP_ID_MSIX)
@@ -150,7 +178,8 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
if (reg && (len == sizeof(u64)))
address = be64_to_cpup(reg);
else
- address = fsl_pci_immrbar_base(hose) + msi_data->msiir_offset;
+ address = fsl_pci_immrbar_base(hose) +
+ (msi_data->msiir & 0xfffff);
msg->address_lo = lower_32_bits(address);
msg->address_hi = upper_32_bits(address);
@@ -393,6 +422,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
const struct fsl_msi_feature *features;
int len;
u32 offset;
+ static atomic_t bank_index = ATOMIC_INIT(-1);
match = of_match_device(fsl_of_msi_ids, &dev->dev);
if (!match)
@@ -436,18 +466,15 @@ static int fsl_of_msi_probe(struct platform_device *dev)
dev->dev.of_node->full_name);
goto error_out;
}
- msi->msiir_offset =
- features->msiir_offset + (res.start & 0xfffff);
/*
* First read the MSIIR/MSIIR1 offset from dts
* On failure use the hardcode MSIIR offset
*/
if (of_address_to_resource(dev->dev.of_node, 1, &msiir))
- msi->msiir_offset = features->msiir_offset +
- (res.start & MSIIR_OFFSET_MASK);
+ msi->msiir = res.start + features->msiir_offset;
else
- msi->msiir_offset = msiir.start & MSIIR_OFFSET_MASK;
+ msi->msiir = msiir.start;
}
msi->feature = features->fsl_pic_ip;
@@ -521,6 +548,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
}
}
+ msi->bank_index = atomic_inc_return(&bank_index);
list_add_tail(&msi->list, &msi_head);
/* The multiple setting ppc_md.setup_msi_irqs will not harm things */
@@ -528,6 +556,8 @@ static int fsl_of_msi_probe(struct platform_device *dev)
ppc_md.setup_msi_irqs = fsl_setup_msi_irqs;
ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs;
ppc_md.msi_check_device = fsl_msi_check_device;
+ ppc_md.msi_get_region_count = fsl_msi_get_region_count;
+ ppc_md.msi_get_region = fsl_msi_get_region;
} else if (ppc_md.setup_msi_irqs != fsl_setup_msi_irqs) {
dev_err(&dev->dev, "Different MSI driver already installed!\n");
err = -ENODEV;
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h
index df9aa9f..a2cc5a2 100644
--- a/arch/powerpc/sysdev/fsl_msi.h
+++ b/arch/powerpc/sysdev/fsl_msi.h
@@ -31,14 +31,21 @@ struct fsl_msi {
struct irq_domain *irqhost;
unsigned long cascade_irq;
-
- u32 msiir_offset; /* Offset of MSIIR, relative to start of CCSR */
+ phys_addr_t msiir; /* MSIIR Address in CCSR */
u32 ibs_shift; /* Shift of interrupt bit select */
u32 srs_shift; /* Shift of the shared interrupt register select */
void __iomem *msi_regs;
u32 feature;
int msi_virqs[NR_MSI_REG_MAX];
+ /*
+ * During probe each bank is assigned a index number.
+ * index number start from 0.
+ * Example MSI bank 1 = 0
+ * MSI bank 2 = 1, and so on.
+ */
+ int bank_index;
+
struct msi_bitmap bitmap;
struct list_head list; /* support multiple MSI banks */
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/5 RFC] powerpc: pci: Add arch specific msi region interface
From: Bharat Bhushan @ 2013-10-29 11:27 UTC (permalink / raw)
To: alex.williamson, joro, galak, scottwood, linux-kernel,
linuxppc-dev, linux-pci, agraf, stuart.yoder
Cc: Bharat Bhushan
In-Reply-To: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com>
This patch adds the interface to get the msi region information from arch
specific code. The machine spicific code is not yet defined.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
arch/powerpc/include/asm/machdep.h | 8 ++++++++
arch/powerpc/kernel/msi.c | 18 ++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 8b48090..8d1b787 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -30,6 +30,7 @@ struct file;
struct pci_controller;
struct kimage;
struct pci_host_bridge;
+struct msi_region;
struct machdep_calls {
char *name;
@@ -124,6 +125,13 @@ struct machdep_calls {
int (*setup_msi_irqs)(struct pci_dev *dev,
int nvec, int type);
void (*teardown_msi_irqs)(struct pci_dev *dev);
+
+ /* Returns the number of MSI regions (banks) */
+ int (*msi_get_region_count)(void);
+
+ /* Returns the requested region's address and size */
+ int (*msi_get_region)(int region_num,
+ struct msi_region *region);
#endif
void (*restart)(char *cmd);
diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
index 8bbc12d..1a67787 100644
--- a/arch/powerpc/kernel/msi.c
+++ b/arch/powerpc/kernel/msi.c
@@ -13,6 +13,24 @@
#include <asm/machdep.h>
+int arch_msi_get_region_count(void)
+{
+ if (ppc_md.msi_get_region_count) {
+ pr_debug("msi: Using platform get_region_count routine.\n");
+ return ppc_md.msi_get_region_count();
+ }
+ return 0;
+}
+
+int arch_msi_get_region(int region_num, struct msi_region *region)
+{
+ if (ppc_md.msi_get_region) {
+ pr_debug("msi: Using platform get_region routine.\n");
+ return ppc_md.msi_get_region(region_num, region);
+ }
+ return 0;
+}
+
int arch_msi_check_device(struct pci_dev* dev, int nvec, int type)
{
if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) {
--
1.7.0.4
^ permalink raw reply related
* [PATCH 5/5 RFC] vfio: setup iova-base for msi interrupts for vfio assigned device
From: Bharat Bhushan @ 2013-10-29 11:27 UTC (permalink / raw)
To: alex.williamson, joro, galak, scottwood, linux-kernel,
linuxppc-dev, linux-pci, agraf, stuart.yoder
Cc: Bharat Bhushan
In-Reply-To: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com>
PAMU (FSL IOMMU) has a concept of primary window and subwindows.
Primary window corresponds to the complete guest iova address space
(including MSI space), with respect to IOMMU_API this is termed as
geometry. IOVA Base of subwindow is determined from the number of
subwindows (configurable using iommu API).
MSI I/O page must be within the geometry and maximum supported
subwindows, so MSI IO-page is setup just after guest memory iova space.
This patch is for setting up MSI iova-base for vfio devices assigned
in msi subsystem, so that when msi-message will be composed then this
configured iova will be used.
According to this design vfio will make msi_set_iova() msi-API call to
setup iova for a device. MSI will keep track of iova-base of all device
under a msi-bank. When composing the MSI address and data this list will
be traversed, if device found in the list then device used by vfio and
its iova-base will be taken from here otherwise iova-base will be taken
as before.
This is a draft patch to describe the interface to setup iova in MSI
(what Alex Williamson proposed earlier on related patchset).
Currently I have bundled all changes in one patch to take initial
review comment on design. I will divide this in multiple logical
patches once this design is accepted.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
arch/powerpc/include/asm/machdep.h | 2 +
arch/powerpc/kernel/msi.c | 10 ++++++
arch/powerpc/sysdev/fsl_msi.c | 64 ++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/fsl_msi.h | 10 ++++-
drivers/pci/msi.c | 12 +++++++
include/linux/pci.h | 8 ++++
6 files changed, 104 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 8d1b787..e87b806 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -132,6 +132,8 @@ struct machdep_calls {
/* Returns the requested region's address and size */
int (*msi_get_region)(int region_num,
struct msi_region *region);
+ int (*msi_set_iova)(struct pci_dev *pdev, int region_num,
+ dma_addr_t iova, bool set);
#endif
void (*restart)(char *cmd);
diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
index 1a67787..e2bd555 100644
--- a/arch/powerpc/kernel/msi.c
+++ b/arch/powerpc/kernel/msi.c
@@ -13,6 +13,16 @@
#include <asm/machdep.h>
+int arch_msi_set_iova(struct pci_dev *pdev, int region_num,
+ dma_addr_t iova, bool set)
+{
+ if (ppc_md.msi_set_iova) {
+ pr_debug("msi: Using platform get_region_count routine.\n");
+ return ppc_md.msi_set_iova(pdev, region_num, iova, set);
+ }
+ return 0;
+}
+
int arch_msi_get_region_count(void)
{
if (ppc_md.msi_get_region_count) {
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index eeebbf0..ad22d74 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -137,6 +137,46 @@ static int fsl_msi_get_region(int region_num, struct msi_region *region)
return -ENODEV;
}
+static int fsl_msi_set_iova(struct pci_dev *pdev, int region_num,
+ dma_addr_t iova, bool set)
+{
+ struct fsl_msi *msi_data;
+ struct fsl_msi_device *device;
+
+ list_for_each_entry(msi_data, &msi_head, list) {
+ if (msi_data->bank_index != region_num)
+ continue;
+ mutex_lock(&msi_data->lock);
+ if (set) {
+ list_for_each_entry(device, &msi_data->device_list, list) {
+ if (device->dev == pdev) {
+ device->iova = iova;
+ mutex_unlock(&msi_data->lock);
+ return 0;
+ }
+ }
+
+ device = kzalloc(sizeof(struct fsl_msi_device), GFP_KERNEL);
+ device->dev = pdev;
+ device->iova = iova;
+ list_add_tail(&device->list, &msi_data->device_list);
+ } else {
+ list_for_each_entry(device, &msi_data->device_list, list) {
+ if (device->dev == pdev) {
+ list_del(&device->list);
+ kfree(device);
+ mutex_unlock(&msi_data->lock);
+ return 0;
+ }
+ }
+ }
+
+ mutex_unlock(&msi_data->lock);
+ break;
+ }
+ return 0;
+}
+
static int fsl_msi_check_device(struct pci_dev *pdev, int nvec, int type)
{
if (type == PCI_CAP_ID_MSIX)
@@ -167,6 +207,7 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
struct msi_msg *msg,
struct fsl_msi *fsl_msi_data)
{
+ struct fsl_msi_device *device;
struct fsl_msi *msi_data = fsl_msi_data;
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
u64 address; /* Physical address of the MSIIR */
@@ -181,6 +222,18 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
address = fsl_pci_immrbar_base(hose) +
(msi_data->msiir & 0xfffff);
+ printk("%s address = %llx\n", __func__, address);
+
+ mutex_lock(&msi_data->lock);
+ list_for_each_entry(device, &msi_data->device_list, list) {
+ if (device->dev == pdev) {
+ address = device->iova | (msi_data->msiir & 0xfff);
+ break;
+ }
+ }
+ mutex_unlock(&msi_data->lock);
+ printk("%s address = %llx\n", __func__, address);
+
msg->address_lo = lower_32_bits(address);
msg->address_hi = upper_32_bits(address);
@@ -356,6 +409,7 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
struct fsl_msi *msi = platform_get_drvdata(ofdev);
int virq, i;
struct fsl_msi_cascade_data *cascade_data;
+ struct fsl_msi_device *device;
if (msi->list.prev != NULL)
list_del(&msi->list);
@@ -371,6 +425,13 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
msi_bitmap_free(&msi->bitmap);
if ((msi->feature & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC)
iounmap(msi->msi_regs);
+
+ mutex_lock(&msi->lock);
+ list_for_each_entry(device, &msi->device_list, list) {
+ list_del(&device->list);
+ kfree(device);
+ }
+ mutex_unlock(&msi->lock);
kfree(msi);
return 0;
@@ -436,6 +497,8 @@ static int fsl_of_msi_probe(struct platform_device *dev)
dev_err(&dev->dev, "No memory for MSI structure\n");
return -ENOMEM;
}
+ INIT_LIST_HEAD(&msi->device_list);
+ mutex_init(&msi->lock);
platform_set_drvdata(dev, msi);
msi->irqhost = irq_domain_add_linear(dev->dev.of_node,
@@ -558,6 +621,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
ppc_md.msi_check_device = fsl_msi_check_device;
ppc_md.msi_get_region_count = fsl_msi_get_region_count;
ppc_md.msi_get_region = fsl_msi_get_region;
+ ppc_md.msi_set_iova = fsl_msi_set_iova;
} else if (ppc_md.setup_msi_irqs != fsl_setup_msi_irqs) {
dev_err(&dev->dev, "Different MSI driver already installed!\n");
err = -ENODEV;
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h
index a2cc5a2..adda5c3 100644
--- a/arch/powerpc/sysdev/fsl_msi.h
+++ b/arch/powerpc/sysdev/fsl_msi.h
@@ -27,9 +27,15 @@
#define FSL_PIC_IP_IPIC 0x00000002
#define FSL_PIC_IP_VMPIC 0x00000003
+struct fsl_msi_device {
+ struct list_head list;
+ struct pci_dev *dev;
+ dma_addr_t iova;
+};
+
struct fsl_msi {
struct irq_domain *irqhost;
-
+ struct mutex lock;
unsigned long cascade_irq;
phys_addr_t msiir; /* MSIIR Address in CCSR */
u32 ibs_shift; /* Shift of interrupt bit select */
@@ -37,7 +43,7 @@ struct fsl_msi {
void __iomem *msi_regs;
u32 feature;
int msi_virqs[NR_MSI_REG_MAX];
-
+ struct list_head device_list;
/*
* During probe each bank is assigned a index number.
* index number start from 0.
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 2643a29..59ec465 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -77,6 +77,18 @@ int __weak arch_msi_get_region(int region_num, struct msi_region *region)
return 0;
}
+int __weak arch_msi_set_iova(struct pci_dev *pdev, int region_num,
+ dma_addr_t iova, bool set)
+{
+ return 0;
+}
+
+int msi_set_iova(struct pci_dev *pdev, int region_num, dma_addr_t iova, bool set)
+{
+ return arch_msi_set_iova(pdev, region_num, iova, set);
+}
+EXPORT_SYMBOL(msi_set_iova);
+
int msi_get_region_count(void)
{
return arch_msi_get_region_count();
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c587034..c6d3e58 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1195,6 +1195,12 @@ static inline int msi_get_region(int region_num, struct msi_region *region)
{
return 0;
}
+
+static inline int msi_set_iova(struct pci_dev *pdev, int region_num,
+ dma_addr_t iova, bool set)
+{
+ return 0;
+}
#else
int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
@@ -1209,6 +1215,8 @@ void pci_restore_msi_state(struct pci_dev *dev);
int pci_msi_enabled(void);
int msi_get_region_count(void);
int msi_get_region(int region_num, struct msi_region *region);
+int msi_set_iova(struct pci_dev *pdev, int region_num,
+ dma_addr_t iova, bool set);
#endif
#ifdef CONFIG_PCIEPORTBUS
--
1.7.0.4
^ permalink raw reply related
* [PATCH 0/5 RFC] vfio/pci: add interface to for MSI support with FSL PAMU
From: Bharat Bhushan @ 2013-10-29 11:27 UTC (permalink / raw)
To: alex.williamson, joro, galak, scottwood, linux-kernel,
linuxppc-dev, linux-pci, agraf, stuart.yoder
Cc: Bharat Bhushan
In-Reply-To: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com>
From: Bharat Bhushan <bharat.bhushan@freescale.com>
PAMU (FSL IOMMU) has a concept of primary window and subwindows.
Primary window corresponds to the complete guest iova address space
(including MSI space), with respect to IOMMU_API this is termed as
geometry. IOVA Base of subwindow is determined from the number of
subwindows (configurable using iommu API).
MSI I/O page must be within the geometry and maximum supported
subwindows, so MSI IO-page is setup just after guest memory iova space.
So first four patches are for defining the interface to get:
- Number of MSI regions (which is number of MSI banks for powerpc)
- MSI-region address range: Physical page which have the
address/addresses used for generating MSI interrupt
and size of the page.
Last Patch is for setting up MSI iova-base for vfio devices assigned
in msi subsystem, so that when msi-message will be composed then this
configured iova will be used. Earlier we were using iommu interface
for getting the configured iova which was not currect and
Alex Williamson suggeested this type of interface.
Bharat Bhushan (5):
pci:msi: add weak function for returning msi region info
powerpc: pci: Add arch specific msi region interface
powerpc: msi: Extend the msi region interface to get info from
fsl_msi
pci: msi: expose msi region information functions
vfio: setup iova-base for msi interrupts for vfio assigned device
arch/powerpc/include/asm/machdep.h | 10 ++++
arch/powerpc/kernel/msi.c | 28 ++++++++++
arch/powerpc/sysdev/fsl_msi.c | 106 ++++++++++++++++++++++++++++++++++--
arch/powerpc/sysdev/fsl_msi.h | 19 ++++++-
drivers/pci/msi.c | 34 ++++++++++++
include/linux/msi.h | 14 +++++
include/linux/pci.h | 21 +++++++
7 files changed, 223 insertions(+), 9 deletions(-)
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Timur Tabi @ 2013-10-29 11:59 UTC (permalink / raw)
To: Nicolin Chen, broonie; +Cc: alsa-devel, linuxppc-dev
In-Reply-To: <1383044688-28596-1-git-send-email-b42378@freescale.com>
Nicolin Chen wrote:
> This patch enables Tx-related SIER_FLAGS only when direction is PLAYBACK
> and does same thing for CAPTURE. Also, after TRIGGER_STOP/PAUSE, it will
> disable SIER_xFLAGS for symmetric.
I'm okay with this patch in principle, but why bother? The sysfs entry
is going to display all interrupts anyway, and so the result will be the
same.
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Nicolin Chen @ 2013-10-29 11:57 UTC (permalink / raw)
To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev
In-Reply-To: <526FA330.3080209@tabi.org>
On Tue, Oct 29, 2013 at 06:59:44AM -0500, Timur Tabi wrote:
> Nicolin Chen wrote:
> >This patch enables Tx-related SIER_FLAGS only when direction is PLAYBACK
> >and does same thing for CAPTURE. Also, after TRIGGER_STOP/PAUSE, it will
> >disable SIER_xFLAGS for symmetric.
>
> I'm okay with this patch in principle, but why bother? The sysfs
> entry is going to display all interrupts anyway, and so the result
> will be the same.
>
Well, actually I just wanted to clear T/RDMAE to disable DMA request,
but it seems to be much easier to do it like this based on current
code and disabling unused interrupts should be better right? :)
Thank you,
Nicolin Chen
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Timur Tabi @ 2013-10-29 12:18 UTC (permalink / raw)
To: Nicolin Chen; +Cc: alsa-devel, broonie, linuxppc-dev
In-Reply-To: <20131029115711.GA9605@MrMyself>
Nicolin Chen wrote:
> Well, actually I just wanted to clear T/RDMAE to disable DMA request,
> but it seems to be much easier to do it like this based on current
> code and disabling unused interrupts should be better right?:)
It's not better if it complicates the code and has no real impact. The
code has been running fine for years the way it is. Unless you can show
me that it actually makes a difference, I will have to NACK this patch.
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Nicolin Chen @ 2013-10-29 12:13 UTC (permalink / raw)
To: Timur Tabi; +Cc: alsa-devel, broonie, linuxppc-dev
In-Reply-To: <526FA78D.2090601@tabi.org>
On Tue, Oct 29, 2013 at 07:18:21AM -0500, Timur Tabi wrote:
> Nicolin Chen wrote:
> >Well, actually I just wanted to clear T/RDMAE to disable DMA request,
> >but it seems to be much easier to do it like this based on current
> >code and disabling unused interrupts should be better right?:)
>
> It's not better if it complicates the code and has no real impact.
> The code has been running fine for years the way it is. Unless you
> can show me that it actually makes a difference, I will have to NACK
> this patch.
>
The DMA request might be remaining high if not disabling it. This would
cause SDMA re-check this request, while it has no BD existing. For the
other interrupts, if you don't like it, I can drop it. Just modification
to the driver might not be less complicated.
Thank you,
Nicolin Chen
^ permalink raw reply
* [PATCH 0/3] Add dual-fifo mode support of i.MX ssi
From: Nicolin Chen @ 2013-10-29 12:33 UTC (permalink / raw)
To: timur, shawn.guo, broonie
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
s.hauer, swarren, linux-kernel, rob.herring, b32955, dmaengine,
ijc+devicetree, linuxppc-dev, linux-arm-kernel
Changelog
v1:
* SSI can reduce hardware overrun/underrun possibility when using dual
* fifo mode. To support this mode, we need to first update sdma sciprt
* list, and then enable dual fifo BIT in SSI driver, and last update DT
* bindings of i.MX series.
*
* ! This series of patches has a direct dependency between them. When
* ! applying them, we need to apply in one single branch. Otherwise,
* ! it would break currect branches.
Nicolin Chen (3):
dma: imx-sdma: Add ssi dual fifo script support
ASoC: fsl_ssi: Add dual fifo mode support
ARM: dts: imx: use dual-fifo sdma script for ssi
.../devicetree/bindings/dma/fsl-imx-sdma.txt | 1 +
arch/arm/boot/dts/imx51.dtsi | 4 ++--
arch/arm/boot/dts/imx53.dtsi | 4 ++--
arch/arm/boot/dts/imx6qdl.dtsi | 12 +++++------
arch/arm/boot/dts/imx6sl.dtsi | 12 +++++------
drivers/dma/imx-sdma.c | 6 +++++-
include/linux/platform_data/dma-imx-sdma.h | 2 ++
include/linux/platform_data/dma-imx.h | 1 +
sound/soc/fsl/fsl_ssi.c | 24 +++++++++++++++++++++-
9 files changed, 48 insertions(+), 18 deletions(-)
--
1.8.4
^ permalink raw reply
* [PATCH 1/3] dma: imx-sdma: Add ssi dual fifo script support
From: Nicolin Chen @ 2013-10-29 12:33 UTC (permalink / raw)
To: timur, shawn.guo, broonie
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
s.hauer, swarren, linux-kernel, rob.herring, b32955, dmaengine,
ijc+devicetree, linuxppc-dev, linux-arm-kernel
In-Reply-To: <cover.1383047327.git.b42378@freescale.com>
There's a script for SSI missing in current sdma script list. Thus add it.
This script would allow SSI use its dual fifo mode to transimit/receive
data without occasional hardware underrun/overrun.
This patch also fixed a counting error for total number of scripts.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
---
Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt | 1 +
drivers/dma/imx-sdma.c | 6 +++++-
include/linux/platform_data/dma-imx-sdma.h | 2 ++
include/linux/platform_data/dma-imx.h | 1 +
4 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
index 4fa814d..3b933c5 100644
--- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
+++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
@@ -42,6 +42,7 @@ The full ID of peripheral types can be found below.
19 IPU Memory
20 ASRC
21 ESAI
+ 22 SSI Dual FIFO
The third cell specifies the transfer priority as below.
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index fc43603..695871f 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -724,6 +724,10 @@ static void sdma_get_pc(struct sdma_channel *sdmac,
per_2_emi = sdma->script_addrs->app_2_mcu_addr;
emi_2_per = sdma->script_addrs->mcu_2_app_addr;
break;
+ case IMX_DMATYPE_SSI_DUAL:
+ per_2_emi = sdma->script_addrs->ssish_2_mcu_addr;
+ emi_2_per = sdma->script_addrs->mcu_2_ssish_addr;
+ break;
case IMX_DMATYPE_SSI_SP:
case IMX_DMATYPE_MMC:
case IMX_DMATYPE_SDHC:
@@ -1237,7 +1241,7 @@ static void sdma_issue_pending(struct dma_chan *chan)
sdma_enable_channel(sdma, sdmac->channel);
}
-#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34
+#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 37
static void sdma_add_scripts(struct sdma_engine *sdma,
const struct sdma_script_start_addrs *addr)
diff --git a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-imx-sdma.h
index 3a39428..19cfa9a 100644
--- a/include/linux/platform_data/dma-imx-sdma.h
+++ b/include/linux/platform_data/dma-imx-sdma.h
@@ -43,6 +43,8 @@ struct sdma_script_start_addrs {
s32 dptc_dvfs_addr;
s32 utra_addr;
s32 ram_code_start_addr;
+ s32 mcu_2_ssish_addr;
+ s32 ssish_2_mcu_addr;
};
/**
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index beac6b8..bcbc6c3 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -39,6 +39,7 @@ enum sdma_peripheral_type {
IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */
IMX_DMATYPE_ASRC, /* ASRC */
IMX_DMATYPE_ESAI, /* ESAI */
+ IMX_DMATYPE_SSI_DUAL, /* SSI Dual FIFO */
};
enum imx_dma_prio {
--
1.8.4
^ permalink raw reply related
* [PATCH 2/3] ASoC: fsl_ssi: Add dual fifo mode support
From: Nicolin Chen @ 2013-10-29 12:33 UTC (permalink / raw)
To: timur, shawn.guo, broonie
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
s.hauer, swarren, linux-kernel, rob.herring, b32955, dmaengine,
ijc+devicetree, linuxppc-dev, linux-arm-kernel
In-Reply-To: <cover.1383047327.git.b42378@freescale.com>
By enabling dual fifo mode, it would allow SSI enter a better performance
to transimit/receive data without occasional hardware underrun/overrun.
[ Passed compile-test with mpc85xx_defconfig ]
Signed-off-by: Nicolin Chen <b42378@freescale.com>
---
sound/soc/fsl/fsl_ssi.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 3797bf0..7ad01ce 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -146,6 +146,7 @@ struct fsl_ssi_private {
bool ssi_on_imx;
bool imx_ac97;
bool use_dma;
+ bool use_dual_fifo;
struct clk *clk;
struct snd_dmaengine_dai_dma_data dma_params_tx;
struct snd_dmaengine_dai_dma_data dma_params_rx;
@@ -416,6 +417,16 @@ static int fsl_ssi_setup(struct fsl_ssi_private *ssi_private)
write_ssi(CCSR_SSI_SOR_WAIT(3), &ssi->sor);
}
+ if (ssi_private->use_dual_fifo) {
+ write_ssi_mask(&ssi->srcr, 0, CCSR_SSI_SRCR_RFEN1);
+ write_ssi_mask(&ssi->stcr, 0, CCSR_SSI_STCR_TFEN1);
+ write_ssi_mask(&ssi->scr, 0, CCSR_SSI_SCR_TCH_EN);
+ } else {
+ write_ssi_mask(&ssi->srcr, CCSR_SSI_SRCR_RFEN1, 0);
+ write_ssi_mask(&ssi->stcr, CCSR_SSI_STCR_TFEN1, 0);
+ write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TCH_EN, 0);
+ }
+
return 0;
}
@@ -952,7 +963,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
ssi_private->fifo_depth = 8;
if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx21-ssi")) {
- u32 dma_events[2];
+ u32 dma_events[2], dmas[4];
ssi_private->ssi_on_imx = true;
ssi_private->clk = devm_clk_get(&pdev->dev, NULL);
@@ -1006,6 +1017,17 @@ static int fsl_ssi_probe(struct platform_device *pdev)
dma_events[0], shared ? IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI);
imx_pcm_dma_params_init_data(&ssi_private->filter_data_rx,
dma_events[1], shared ? IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI);
+ if (!of_property_read_u32_array(pdev->dev.of_node, "dmas", dmas, 4)
+ && dmas[2] == IMX_DMATYPE_SSI_DUAL) {
+ ssi_private->use_dual_fifo = true;
+ /* When using dual fifo mode, we need to keep watermark
+ * as even numbers due to dma script limitation.
+ */
+ ssi_private->dma_params_tx.maxburst /= 2;
+ ssi_private->dma_params_tx.maxburst *= 2;
+ ssi_private->dma_params_rx.maxburst /= 2;
+ ssi_private->dma_params_rx.maxburst *= 2;
+ }
} else if (ssi_private->use_dma) {
/* The 'name' should not have any slashes in it. */
ret = devm_request_irq(&pdev->dev, ssi_private->irq,
--
1.8.4
^ permalink raw reply related
* [PATCH 3/3] ARM: dts: imx: use dual-fifo sdma script for ssi
From: Nicolin Chen @ 2013-10-29 12:33 UTC (permalink / raw)
To: timur, shawn.guo, broonie
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
s.hauer, swarren, linux-kernel, rob.herring, b32955, dmaengine,
ijc+devicetree, linuxppc-dev, linux-arm-kernel
In-Reply-To: <cover.1383047327.git.b42378@freescale.com>
Use dual-fifo sdma scripts instead of shared scripts for ssi on i.MX series.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
---
arch/arm/boot/dts/imx51.dtsi | 4 ++--
arch/arm/boot/dts/imx53.dtsi | 4 ++--
arch/arm/boot/dts/imx6qdl.dtsi | 12 ++++++------
arch/arm/boot/dts/imx6sl.dtsi | 12 ++++++------
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 54cee65..1a71eac 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -154,8 +154,8 @@
reg = <0x70014000 0x4000>;
interrupts = <30>;
clocks = <&clks 49>;
- dmas = <&sdma 24 1 0>,
- <&sdma 25 1 0>;
+ dmas = <&sdma 24 22 0>,
+ <&sdma 25 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
fsl,ssi-dma-events = <25 24 23 22>; /* TX0 RX0 TX1 RX1 */
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 4307e80..7208fde 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -153,8 +153,8 @@
reg = <0x50014000 0x4000>;
interrupts = <30>;
clocks = <&clks 49>;
- dmas = <&sdma 24 1 0>,
- <&sdma 25 1 0>;
+ dmas = <&sdma 24 22 0>,
+ <&sdma 25 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
fsl,ssi-dma-events = <25 24 23 22>; /* TX0 RX0 TX1 RX1 */
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 57e9c38..6e096ca 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -223,8 +223,8 @@
reg = <0x02028000 0x4000>;
interrupts = <0 46 0x04>;
clocks = <&clks 178>;
- dmas = <&sdma 37 1 0>,
- <&sdma 38 1 0>;
+ dmas = <&sdma 37 22 0>,
+ <&sdma 38 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
fsl,ssi-dma-events = <38 37>;
@@ -236,8 +236,8 @@
reg = <0x0202c000 0x4000>;
interrupts = <0 47 0x04>;
clocks = <&clks 179>;
- dmas = <&sdma 41 1 0>,
- <&sdma 42 1 0>;
+ dmas = <&sdma 41 22 0>,
+ <&sdma 42 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
fsl,ssi-dma-events = <42 41>;
@@ -249,8 +249,8 @@
reg = <0x02030000 0x4000>;
interrupts = <0 48 0x04>;
clocks = <&clks 180>;
- dmas = <&sdma 45 1 0>,
- <&sdma 46 1 0>;
+ dmas = <&sdma 45 22 0>,
+ <&sdma 46 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
fsl,ssi-dma-events = <46 45>;
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index c46651e..b32ba99 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -195,8 +195,8 @@
reg = <0x02028000 0x4000>;
interrupts = <0 46 0x04>;
clocks = <&clks IMX6SL_CLK_SSI1>;
- dmas = <&sdma 37 1 0>,
- <&sdma 38 1 0>;
+ dmas = <&sdma 37 22 0>,
+ <&sdma 38 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
status = "disabled";
@@ -207,8 +207,8 @@
reg = <0x0202c000 0x4000>;
interrupts = <0 47 0x04>;
clocks = <&clks IMX6SL_CLK_SSI2>;
- dmas = <&sdma 41 1 0>,
- <&sdma 42 1 0>;
+ dmas = <&sdma 41 22 0>,
+ <&sdma 42 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
status = "disabled";
@@ -219,8 +219,8 @@
reg = <0x02030000 0x4000>;
interrupts = <0 48 0x04>;
clocks = <&clks IMX6SL_CLK_SSI3>;
- dmas = <&sdma 45 1 0>,
- <&sdma 46 1 0>;
+ dmas = <&sdma 45 22 0>,
+ <&sdma 46 22 0>;
dma-names = "rx", "tx";
fsl,fifo-depth = <15>;
status = "disabled";
--
1.8.4
^ permalink raw reply related
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Timur Tabi @ 2013-10-29 12:40 UTC (permalink / raw)
To: Nicolin Chen; +Cc: alsa-devel, broonie, linuxppc-dev
In-Reply-To: <20131029121330.GB9605@MrMyself>
Nicolin Chen wrote:
> The DMA request might be remaining high if not disabling it.
Might? Are you just guessing?
> This would
> cause SDMA re-check this request, while it has no BD existing. For the
> other interrupts, if you don't like it, I can drop it. Just modification
> to the driver might not be less complicated.
I'm only talking about this particular patch.
^ permalink raw reply
* Re: [PATCH 2/3] ASoC: fsl_ssi: Add dual fifo mode support
From: Timur Tabi @ 2013-10-29 12:42 UTC (permalink / raw)
To: Nicolin Chen, shawn.guo, broonie
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
s.hauer, swarren, linux-kernel, rob.herring, b32955, dmaengine,
ijc+devicetree, linuxppc-dev, linux-arm-kernel
In-Reply-To: <02f8867363ed3038a0a70703856e4b642fef4339.1383047327.git.b42378@freescale.com>
Nicolin Chen wrote:
> By enabling dual fifo mode, it would allow SSI enter a better performance
> to transimit/receive data without occasional hardware underrun/overrun.
Have you measured any real performance gain with this patch? I
considered adding dual-FIFO support when I originally wrote this driver,
but it didn't appear to have any real benefit, but it used twice as many
DMA channels.
I'm concerned that this is another patch that just enables a useless
feature.
^ permalink raw reply
* Re: [PATCH 2/3] ASoC: fsl_ssi: Add dual fifo mode support
From: Chen Guangyu-B42378 @ 2013-10-29 12:53 UTC (permalink / raw)
To: Timur Tabi
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, s.hauer@pengutronix.de,
swarren@wwwdotorg.org, linux-kernel@vger.kernel.org,
rob.herring@calxeda.com, Huang Shijie-B32955, broonie@kernel.org,
ijc+devicetree@hellion.org.uk, dmaengine@vger.kernel.org,
shawn.guo@linaro.org, linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <526FAD41.2000805@tabi.org>
Without dual fifo support, handware underrun would occasionally occur and =
then two audio channels would physically swap. This could be easily reprodu=
ced in low bus frequency situation, while it would be better if we enable d=
ual fifo.
Sent by Android device.
Timur Tabi <timur@tabi.org> wrote:
Nicolin Chen wrote:
> By enabling dual fifo mode, it would allow SSI enter a better performance
> to transimit/receive data without occasional hardware underrun/overrun.
Have you measured any real performance gain with this patch? I
considered adding dual-FIFO support when I originally wrote this driver,
but it didn't appear to have any real benefit, but it used twice as many
DMA channels.
I'm concerned that this is another patch that just enables a useless
feature.
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Chen Guangyu-B42378 @ 2013-10-29 13:00 UTC (permalink / raw)
To: Timur Tabi
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <526FACC1.7010909@tabi.org>
I mean there is a possibility.
I'm sorry if my patch is kinda annoying and it really bother you, sir. I a=
lso want to make things better.
If you really don't like it, we can drop it. It's all your call.
And thank you for reviewing.
Sent by Android device.
Timur Tabi <timur@tabi.org> wrote:
Nicolin Chen wrote:
> The DMA request might be remaining high if not disabling it.
Might? Are you just guessing?
> This would
> cause SDMA re-check this request, while it has no BD existing. For the
> other interrupts, if you don't like it, I can drop it. Just modification
> to the driver might not be less complicated.
I'm only talking about this particular patch.
^ permalink raw reply
* Re: [PATCH 2/3] ASoC: fsl_ssi: Add dual fifo mode support
From: Timur Tabi @ 2013-10-29 13:00 UTC (permalink / raw)
To: Chen Guangyu-B42378
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, s.hauer@pengutronix.de,
swarren@wwwdotorg.org, linux-kernel@vger.kernel.org,
rob.herring@calxeda.com, Huang Shijie-B32955, broonie@kernel.org,
ijc+devicetree@hellion.org.uk, dmaengine@vger.kernel.org,
shawn.guo@linaro.org, linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <flq2m8se8fxm4icha4yrpcbn.1383051217235@email.android.com>
Chen Guangyu-B42378 wrote:
> Without dual fifo support, handware underrun would occasionally
> occur and then two audio channels would physically swap. This could
> be easily reproduced in low bus frequency situation, while it would
> be better if we enable dual fifo.
Ok.
ACK.
^ permalink raw reply
* Re: [PATCH 2/3] ASoC: fsl_ssi: Add dual fifo mode support
From: Chen Guangyu-B42378 @ 2013-10-29 13:03 UTC (permalink / raw)
To: Timur Tabi
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, s.hauer@pengutronix.de,
swarren@wwwdotorg.org, linux-kernel@vger.kernel.org,
rob.herring@calxeda.com, Huang Shijie-B32955, broonie@kernel.org,
ijc+devicetree@hellion.org.uk, dmaengine@vger.kernel.org,
shawn.guo@linaro.org, linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <526FB17C.3090009@tabi.org>
Thank you, sir. And sorry for taking your time.
Sent by Android device.
Timur Tabi <timur@tabi.org> wrote:
Chen Guangyu-B42378 wrote:
> Without dual fifo support, handware underrun would occasionally
> occur and then two audio channels would physically swap. This could
> be easily reproduced in low bus frequency situation, while it would
> be better if we enable dual fifo.
Ok.
ACK.
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Timur Tabi @ 2013-10-29 13:14 UTC (permalink / raw)
To: Chen Guangyu-B42378
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <50y5h8hi19x5t2r9jhjrk097.1383051600782@email.android.com>
Chen Guangyu-B42378 wrote:
> I mean there is a possibility.
>
> I'm sorry if my patch is kinda annoying and it really bother you, sir. I also want to make things better.
It does not bother me. I'm glad people are working on my driver. I
just want to make sure that my driver does not get bloated.
>
> If you really don't like it, we can drop it. It's all your call.
I think this patch should be dropped, because I don't see any real
reason for it.
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: separately enable and disable TIE/RIE in trigger()
From: Chen Guangyu-B42378 @ 2013-10-29 13:16 UTC (permalink / raw)
To: Timur Tabi
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <526FB499.5090506@tabi.org>
As you wish, sir.
Sent by Android device.
Timur Tabi <timur@tabi.org> wrote:
Chen Guangyu-B42378 wrote:
> I mean there is a possibility.
>
> I'm sorry if my patch is kinda annoying and it really bother you, sir. =
I also want to make things better.
It does not bother me. I'm glad people are working on my driver. I
just want to make sure that my driver does not get bloated.
>
> If you really don't like it, we can drop it. It's all your call.
I think this patch should be dropped, because I don't see any real
reason for it.
^ permalink raw reply
* Re: [PATCH 1/3] sched: Fix nohz_kick_needed to consider the nr_busy of the parent domain's group
From: Peter Zijlstra @ 2013-10-29 13:26 UTC (permalink / raw)
To: Preeti U Murthy
Cc: Michael Neuling, Vincent Guittot, Mike Galbraith, linuxppc-dev,
linux-kernel, Anton Blanchard, Paul Turner, Ingo Molnar
In-Reply-To: <526F2BEC.3040207@linux.vnet.ibm.com>
On Tue, Oct 29, 2013 at 09:00:52AM +0530, Preeti U Murthy wrote:
> > Oh nice, that gets rid of the multiple atomics, and it nicely splits
> > this nohz logic into per topology groups -- now if only we could split
> > the rest too :-)
>
> I am sorry, I don't get you here. By the 'rest', do you refer to
> nohz_kick_needed() as below? Or am I missing something?
Nah, the rest of the NOHZ infrastructure. Currently its global state;
there were some patches a few years ago that attempted to make that
per-node state, but that work stalled due to people switching jobs.
> >> + sd = highest_flag_domain(cpu, SD_ASYM_PACKING);
> >> +
> >> + if (sd && (cpumask_first_and(nohz.idle_cpus_mask,
> >> + sched_domain_span(sd)) < cpu))
> >> + goto need_kick_unlock;
> >> +
> >> rcu_read_unlock();
> >> return 0;
> >
> > This again is a bit sad; most archs will not have SD_ASYM_PACKING set at
> > all; this means that they all will do a complete (and pointless) sched
> > domain tree walk here.
>
> There will not be a 'complete' sched domain tree walk right? The
> iteration will break at the first level of the sched domain for those
> archs which do not have SD_ASYM_PACKING set at all.
Ah indeed; I think I got confused due to me modifying
highest_flag_domain() earlier to assume a flag is carried from the
lowest domain upwards.
> But it is true that doing a sched domain tree walk regularly is a bad
> idea, might as well update the domain with SD_ASYM_PACKING flag set once
> and query this domain when required.
>
> I will send out the patch with sd_asym domain introduced rather than the
> above.
Thanks
^ permalink raw reply
* Re: [PATCH 1/3] dma: imx-sdma: Add ssi dual fifo script support
From: Sascha Hauer @ 2013-10-29 13:51 UTC (permalink / raw)
To: Nicolin Chen
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
swarren, timur, rob.herring, linux-kernel, b32955, broonie,
ijc+devicetree, dmaengine, shawn.guo, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <9ed025d4e98f716ba80b27acaaa98f43ad3bd75a.1383047327.git.b42378@freescale.com>
On Tue, Oct 29, 2013 at 08:33:15PM +0800, Nicolin Chen wrote:
> There's a script for SSI missing in current sdma script list. Thus add it.
> This script would allow SSI use its dual fifo mode to transimit/receive
> data without occasional hardware underrun/overrun.
>
> This patch also fixed a counting error for total number of scripts.
Look at drivers/dma/imx-sdma.c:
> /**
> * struct sdma_firmware_header - Layout of the firmware image
> *
> * @magic "SDMA"
> * @version_major increased whenever layout of struct
> * sdma_script_start_addrs
> * changes.
Can you image why this firmware has a version field? Right, it's because
it encodes the layout of struct sdma_script_start_addrs.
As the comment clearly states you have to *increase this field* when you
add scripts.
Obviously you missed that, as the firmware on lkml posted recently
shows:
> 00000000: 414d4453 00000001 00000001 0000001c SDMA............
^^^^^^^^
Still '1'
> 00000010: 00000026 000000b4 0000067a 00000282 &.......z.......
> 00000020: ffffffff 00000000 ffffffff ffffffff ................
> 00000030: ffffffff ffffffff ffffffff ffffffff ................
> 00000040: ffffffff ffffffff 00001a6a ffffffff ........j.......
> 00000050: 000002eb 000018bb ffffffff 00000408 ................
> 00000060: ffffffff 000003c0 ffffffff ffffffff ................
> 00000070: ffffffff 000002ab ffffffff 0000037b ............{...
> 00000080: ffffffff ffffffff 0000044c 0000046e ........L...n...
> 00000090: ffffffff 00001800 ffffffff ffffffff ................
> 000000a0: 00000000 00001800 00001862 00001a16 ........b.......
^^^^^^^^^^^^^^^^^
new script addresses introduced
> -#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34
> +#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 37
And no, this is not a bug. It's your firmware header that is buggy.
What you need is:
#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2 37
You (you as a company, not you as a person) knew that it was me who
created this firmware format. So it was absolutely unnecessary to create
an incompatible firmware instead of dropping me a short note.
Please add a version check to the driver as necessary and provide a proper
firmware.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: PCIE device errors after linux kernel upgrade
From: ravich @ 2013-10-29 15:07 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <CAErSpo49ZLfxkEanmrrwwiqHR8koiCakqe9h8My2Mu1yA4R1Ww@mail.gmail.com>
Nope , same situation, can't find whats wrong :(
--
View this message in context: http://linuxppc.10917.n7.nabble.com/Re-PCIE-device-errors-after-linux-kernel-upgrade-tp74563p77605.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH 1/3] dma: imx-sdma: Add ssi dual fifo script support
From: Kumar Gala @ 2013-10-29 17:21 UTC (permalink / raw)
To: Nicolin Chen
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
s.hauer, swarren, timur, rob.herring, linux-kernel, b32955,
broonie, ijc+devicetree, dmaengine, shawn.guo, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <9ed025d4e98f716ba80b27acaaa98f43ad3bd75a.1383047327.git.b42378@freescale.com>
On Oct 29, 2013, at 7:33 AM, Nicolin Chen wrote:
> There's a script for SSI missing in current sdma script list. Thus add =
it.
> This script would allow SSI use its dual fifo mode to =
transimit/receive
> data without occasional hardware underrun/overrun.
>=20
> This patch also fixed a counting error for total number of scripts.
>=20
> Signed-off-by: Nicolin Chen <b42378@freescale.com>
> ---
> Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt | 1 +
> drivers/dma/imx-sdma.c | 6 +++++-
> include/linux/platform_data/dma-imx-sdma.h | 2 ++
> include/linux/platform_data/dma-imx.h | 1 +
> 4 files changed, 9 insertions(+), 1 deletion(-)
>=20
> diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt =
b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> index 4fa814d..3b933c5 100644
> --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> @@ -42,6 +42,7 @@ The full ID of peripheral types can be found below.
> 19 IPU Memory
> 20 ASRC
> 21 ESAI
> + 22 SSI Dual FIFO
>=20
> The third cell specifies the transfer priority as below.
For the DT-Binding portion:
Acked-by: Kumar Gala <galak@codeaurora.org>
- k
--=20
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, =
hosted by The Linux Foundation
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox