Currently this driver only works with a DesignWare DMA engine which it
registers manually using the second "reg" address range and interrupt
number from the DT node.
This patch makes the driver instead use the "dmas" property if present,
otherwise optionally falling back on the old way so existing device
trees can continue to work.
With this change, there is no longer any reason to depend on the 460EX
machine type so drop that from Kconfig.
Signed-off-by: Mans Rullgard <[email protected]>
---
drivers/ata/Kconfig | 10 ++-
drivers/ata/sata_dwc_460ex.c | 192 +++++++++++++++++++++++++++----------------
2 files changed, 131 insertions(+), 71 deletions(-)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 3fc2a56..193c673 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -296,14 +296,20 @@ config ATA_PIIX
config SATA_DWC
tristate "DesignWare Cores SATA support"
- depends on 460EX
- select DW_DMAC
help
This option enables support for the on-chip SATA controller of the
AppliedMicro processor 460EX.
If unsure, say N.
+config SATA_DWC_OLD_DMA
+ bool "Support old device trees"
+ depends on SATA_DWC && 460EX
+ select DW_DMAC
+ help
+ This option enables support for old device trees without the
+ "dmas" property.
+
config SATA_DWC_DEBUG
bool "Debugging driver version"
depends on SATA_DWC
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 9020349..9985749 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -30,6 +30,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
+#include <linux/dmaengine.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
@@ -42,10 +43,6 @@
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
-/* Supported DMA engine drivers */
-#include <linux/platform_data/dma-dw.h>
-#include <linux/dma/dw.h>
-
/* These two are defined in "libata.h" */
#undef DRV_NAME
#undef DRV_VERSION
@@ -148,7 +145,9 @@ struct sata_dwc_device {
struct ata_host *host;
u8 __iomem *reg_base;
struct sata_dwc_regs *sata_dwc_regs; /* DW Synopsys SATA specific */
+#ifdef CONFIG_SATA_DWC_OLD_DMA
struct dw_dma_chip *dma;
+#endif
};
#define SATA_DWC_QCMD_MAX 32
@@ -159,7 +158,6 @@ struct sata_dwc_device_port {
int dma_pending[SATA_DWC_QCMD_MAX];
/* DMA info */
- struct dw_dma_slave *dws;
struct dma_chan *chan;
struct dma_async_tx_descriptor *desc[SATA_DWC_QCMD_MAX];
u32 dma_interrupt_count;
@@ -198,13 +196,6 @@ struct sata_dwc_host_priv {
static struct sata_dwc_host_priv host_pvt;
-static struct dw_dma_slave sata_dwc_dma_dws = {
- .src_id = 0,
- .dst_id = 0,
- .src_master = 0,
- .dst_master = 1,
-};
-
/*
* Prototypes
*/
@@ -215,6 +206,90 @@ static void sata_dwc_dma_xfer_complete(struct ata_port *ap, u32 check_status);
static void sata_dwc_port_stop(struct ata_port *ap);
static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag);
+#ifdef CONFIG_SATA_DWC_OLD_DMA
+
+#include <linux/platform_data/dma-dw.h>
+#include <linux/dma/dw.h>
+
+static struct dw_dma_slave sata_dwc_dma_dws = {
+ .src_id = 0,
+ .dst_id = 0,
+ .src_master = 0,
+ .dst_master = 1,
+};
+
+static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
+{
+ struct dw_dma_slave *dws = &sata_dwc_dma_dws;
+
+ if (dws->dma_dev != chan->device->dev)
+ return false;
+
+ chan->private = dws;
+ return true;
+}
+
+static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port *hsdevp)
+{
+ struct sata_dwc_device *hsdev = hsdevp->hsdev;
+ struct dw_dma_slave *dws = &sata_dwc_dma_dws;
+ dma_cap_mask_t mask;
+
+ dws->dma_dev = hsdev->dev;
+
+ dma_cap_zero(mask);
+ dma_cap_set(DMA_SLAVE, mask);
+
+ /* Acquire DMA channel */
+ hsdevp->chan = dma_request_channel(mask, sata_dwc_dma_filter, hsdevp);
+ if (!hsdevp->chan) {
+ dev_err(hsdev->dev, "%s: dma channel unavailable\n",
+ __func__);
+ return -EAGAIN;
+ }
+
+ return 0;
+}
+
+static int sata_dwc_dma_init_old(struct platform_device *pdev,
+ struct sata_dwc_device *hsdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+ int err;
+
+ hsdev->dma = devm_kzalloc(&pdev->dev, sizeof(*hsdev->dma), GFP_KERNEL);
+ if (!hsdev->dma)
+ return -ENOMEM;
+
+ hsdev->dma->dev = &pdev->dev;
+
+ /* Get SATA DMA interrupt number */
+ hsdev->dma->irq = irq_of_parse_and_map(np, 1);
+ if (hsdev->dma->irq == NO_IRQ) {
+ dev_err(&pdev->dev, "no SATA DMA irq\n");
+ return -ENODEV;
+ }
+
+ /* Get physical SATA DMA register base address */
+ hsdev->dma->regs = of_iomap(np, 1);
+ if (!hsdev->dma->regs) {
+ dev_err(&pdev->dev,
+ "ioremap failed for AHBDMA register address\n");
+ return -ENODEV;
+ }
+
+ /* Initialize AHB DMAC */
+ err = dw_dma_probe(hsdev->dma, NULL);
+ if (err) {
+ iounmap(hsdev->dma->regs);
+ return err;
+ }
+
+ return 0;
+}
+
+#endif
+
static const char *get_prot_descript(u8 protocol)
{
switch ((enum ata_tf_protocols)protocol) {
@@ -783,18 +858,6 @@ static void sata_dwc_enable_interrupts(struct sata_dwc_device *hsdev)
in_le32(&hsdev->sata_dwc_regs->errmr));
}
-static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
-{
- struct sata_dwc_device_port *hsdevp = param;
- struct dw_dma_slave *dws = hsdevp->dws;
-
- if (dws->dma_dev != chan->device->dev)
- return false;
-
- chan->private = dws;
- return true;
-}
-
static void sata_dwc_setup_port(struct ata_ioports *port, unsigned long base)
{
port->cmd_addr = (void __iomem *)base + 0x00;
@@ -817,6 +880,26 @@ static void sata_dwc_setup_port(struct ata_ioports *port, unsigned long base)
port->ctl_addr = (void __iomem *)base + 0x20;
}
+static int sata_dwc_dma_get_channel(struct sata_dwc_device_port *hsdevp)
+{
+ struct sata_dwc_device *hsdev = hsdevp->hsdev;
+ struct device *dev = hsdev->dev;
+
+#ifdef CONFIG_SATA_DWC_OLD_DMA
+ if (!of_find_property(dev->of_node, "dmas", NULL))
+ return sata_dwc_dma_get_channel_old(hsdevp);
+#endif
+
+ hsdevp->chan = dma_request_slave_channel(dev, "sata-dma");
+ if (IS_ERR(hsdevp->chan)) {
+ dev_err(dev, "failed to allocate dma channel: %ld\n",
+ PTR_ERR(hsdevp->chan));
+ return PTR_ERR(hsdevp->chan);
+ }
+
+ return 0;
+}
+
/*
* Function : sata_dwc_port_start
* arguments : struct ata_ioports *port
@@ -829,7 +912,6 @@ static int sata_dwc_port_start(struct ata_port *ap)
struct sata_dwc_device *hsdev;
struct sata_dwc_device_port *hsdevp = NULL;
struct device *pdev;
- dma_cap_mask_t mask;
int i;
hsdev = HSDEV_FROM_AP(ap);
@@ -853,20 +935,9 @@ static int sata_dwc_port_start(struct ata_port *ap)
}
hsdevp->hsdev = hsdev;
- hsdevp->dws = &sata_dwc_dma_dws;
- hsdevp->dws->dma_dev = hsdev->dev;
-
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
-
- /* Acquire DMA channel */
- hsdevp->chan = dma_request_channel(mask, sata_dwc_dma_filter, hsdevp);
- if (!hsdevp->chan) {
- dev_err(hsdev->dev, "%s: dma channel unavailable\n",
- __func__);
- err = -EAGAIN;
+ err = sata_dwc_dma_get_channel(hsdevp);
+ if (err)
goto CLEANUP_ALLOC;
- }
for (i = 0; i < SATA_DWC_QCMD_MAX; i++)
hsdevp->cmd_issued[i] = SATA_DWC_CMD_ISSUED_NOT;
@@ -1225,33 +1296,9 @@ static int sata_dwc_probe(struct platform_device *ofdev)
dev_notice(&ofdev->dev, "id %d, controller version %c.%c%c\n",
idr, ver[0], ver[1], ver[2]);
- /* Get SATA DMA interrupt number */
- hsdev->dma->irq = irq_of_parse_and_map(np, 1);
- if (hsdev->dma->irq == NO_IRQ) {
- dev_err(&ofdev->dev, "no SATA DMA irq\n");
- err = -ENODEV;
- goto error_iomap;
- }
-
- /* Get physical SATA DMA register base address */
- hsdev->dma->regs = of_iomap(np, 1);
- if (!hsdev->dma->regs) {
- dev_err(&ofdev->dev,
- "ioremap failed for AHBDMA register address\n");
- err = -ENODEV;
- goto error_iomap;
- }
-
/* Save dev for later use in dev_xxx() routines */
hsdev->dev = &ofdev->dev;
- hsdev->dma->dev = &ofdev->dev;
-
- /* Initialize AHB DMAC */
- err = dw_dma_probe(hsdev->dma, NULL);
- if (err)
- goto error_dma_iomap;
-
/* Enable SATA Interrupts */
sata_dwc_enable_interrupts(hsdev);
@@ -1263,6 +1310,14 @@ static int sata_dwc_probe(struct platform_device *ofdev)
goto error_out;
}
+#ifdef CONFIG_SATA_DWC_OLD_DMA
+ if (!of_find_property(np, "dmas", NULL)) {
+ err = sata_dwc_dma_init_old(ofdev, hsdev);
+ if (err)
+ goto error_out;
+ }
+#endif
+
/*
* Now, register with libATA core, this will also initiate the
* device discovery process, invoking our port_start() handler &
@@ -1276,11 +1331,6 @@ static int sata_dwc_probe(struct platform_device *ofdev)
return 0;
error_out:
- /* Free SATA DMA resources */
- dw_dma_remove(hsdev->dma);
-error_dma_iomap:
- iounmap(hsdev->dma->regs);
-error_iomap:
iounmap(base);
return err;
}
@@ -1293,10 +1343,14 @@ static int sata_dwc_remove(struct platform_device *ofdev)
ata_host_detach(host);
+#ifdef CONFIG_SATA_DWC_OLD_DMA
/* Free SATA DMA resources */
- dw_dma_remove(hsdev->dma);
+ if (hsdev->dma) {
+ dw_dma_remove(hsdev->dma);
+ iounmap(hsdev->dma->regs);
+ }
+#endif
- iounmap(hsdev->dma->regs);
iounmap(hsdev->reg_base);
dev_dbg(&ofdev->dev, "done\n");
return 0;
--
2.6.3
This adds support for powering on an optional PHY when activating the
device.
Signed-off-by: Mans Rullgard <[email protected]>
---
drivers/ata/Kconfig | 1 +
drivers/ata/sata_dwc_460ex.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 193c673..b13c609 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -296,6 +296,7 @@ config ATA_PIIX
config SATA_DWC
tristate "DesignWare Cores SATA support"
+ select GENERIC_PHY
help
This option enables support for the on-chip SATA controller of the
AppliedMicro processor 460EX.
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 9985749..d07aae1 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -35,6 +35,7 @@
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
+#include <linux/phy/phy.h>
#include <linux/libata.h>
#include <linux/slab.h>
@@ -145,6 +146,7 @@ struct sata_dwc_device {
struct ata_host *host;
u8 __iomem *reg_base;
struct sata_dwc_regs *sata_dwc_regs; /* DW Synopsys SATA specific */
+ struct phy *phy;
#ifdef CONFIG_SATA_DWC_OLD_DMA
struct dw_dma_chip *dma;
#endif
@@ -1318,6 +1320,21 @@ static int sata_dwc_probe(struct platform_device *ofdev)
}
#endif
+ hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy");
+ if (IS_ERR(hsdev->phy)) {
+ err = PTR_ERR(hsdev->phy);
+ hsdev->phy = NULL;
+ goto error_out;
+ }
+
+ err = phy_init(hsdev->phy);
+ if (err)
+ goto error_out;
+
+ err = phy_power_on(hsdev->phy);
+ if (err)
+ goto error_out;
+
/*
* Now, register with libATA core, this will also initiate the
* device discovery process, invoking our port_start() handler &
@@ -1331,6 +1348,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
return 0;
error_out:
+ phy_exit(hsdev->phy);
iounmap(base);
return err;
}
@@ -1343,6 +1361,9 @@ static int sata_dwc_remove(struct platform_device *ofdev)
ata_host_detach(host);
+ phy_power_off(hsdev->phy);
+ phy_exit(hsdev->phy);
+
#ifdef CONFIG_SATA_DWC_OLD_DMA
/* Free SATA DMA resources */
if (hsdev->dma) {
--
2.6.3
This moves all global data into the driver private struct, thus
permitting multiple devices of this type to be used.
Signed-off-by: Mans Rullgard <[email protected]>
---
drivers/ata/sata_dwc_460ex.c | 80 ++++++++++++++++++++------------------------
1 file changed, 36 insertions(+), 44 deletions(-)
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index d07aae1..919f870 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -146,6 +146,8 @@ struct sata_dwc_device {
struct ata_host *host;
u8 __iomem *reg_base;
struct sata_dwc_regs *sata_dwc_regs; /* DW Synopsys SATA specific */
+ u32 sactive_issued;
+ u32 sactive_queued;
struct phy *phy;
#ifdef CONFIG_SATA_DWC_OLD_DMA
struct dw_dma_chip *dma;
@@ -190,14 +192,6 @@ enum {
SATA_DWC_DMA_PENDING_RX = 2,
};
-struct sata_dwc_host_priv {
- void __iomem *scr_addr_sstatus;
- u32 sata_dwc_sactive_issued ;
- u32 sata_dwc_sactive_queued ;
-};
-
-static struct sata_dwc_host_priv host_pvt;
-
/*
* Prototypes
*/
@@ -448,21 +442,22 @@ static int sata_dwc_scr_write(struct ata_link *link, unsigned int scr, u32 val)
return 0;
}
-static u32 core_scr_read(unsigned int scr)
+static u32 core_scr_read(struct sata_dwc_device *hsdev, unsigned int scr)
{
- return in_le32(host_pvt.scr_addr_sstatus + (scr * 4));
+ return in_le32(hsdev->reg_base + SATA_DWC_SCR_OFFSET + (scr * 4));
}
-static void core_scr_write(unsigned int scr, u32 val)
+static void core_scr_write(struct sata_dwc_device *hsdev, unsigned int scr,
+ u32 val)
{
- out_le32(host_pvt.scr_addr_sstatus + (scr * 4), val);
+ out_le32(hsdev->reg_base + SATA_DWC_SCR_OFFSET + (scr * 4), val);
}
-static void clear_serror(void)
+static void clear_serror(struct sata_dwc_device *hsdev)
{
u32 val;
- val = core_scr_read(SCR_ERROR);
- core_scr_write(SCR_ERROR, val);
+ val = core_scr_read(hsdev, SCR_ERROR);
+ core_scr_write(hsdev, SCR_ERROR, val);
}
static void clear_interrupt_bit(struct sata_dwc_device *hsdev, u32 bit)
@@ -489,7 +484,7 @@ static void sata_dwc_error_intr(struct ata_port *ap,
ata_ehi_clear_desc(ehi);
- serror = core_scr_read(SCR_ERROR);
+ serror = core_scr_read(hsdev, SCR_ERROR);
status = ap->ops->sff_check_status(ap);
tag = ap->link.active_tag;
@@ -500,7 +495,7 @@ static void sata_dwc_error_intr(struct ata_port *ap,
hsdevp->dma_pending[tag], hsdevp->cmd_issued[tag]);
/* Clear error register and interrupt bit */
- clear_serror();
+ clear_serror(hsdev);
clear_interrupt_bit(hsdev, SATA_DWC_INTPR_ERR);
/* This is the only error happening now. TODO check for exact error */
@@ -539,7 +534,7 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
int handled, num_processed, port = 0;
uint intpr, sactive, sactive2, tag_mask;
struct sata_dwc_device_port *hsdevp;
- host_pvt.sata_dwc_sactive_issued = 0;
+ hsdev->sactive_issued = 0;
spin_lock_irqsave(&host->lock, flags);
@@ -568,7 +563,7 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
if (hsdevp->cmd_issued[tag] != SATA_DWC_CMD_ISSUED_PEND)
dev_warn(ap->dev, "CMD tag=%d not pending?\n", tag);
- host_pvt.sata_dwc_sactive_issued |= qcmd_tag_to_mask(tag);
+ hsdev->sactive_issued |= qcmd_tag_to_mask(tag);
qc = ata_qc_from_tag(ap, tag);
/*
@@ -582,11 +577,11 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
handled = 1;
goto DONE;
}
- sactive = core_scr_read(SCR_ACTIVE);
- tag_mask = (host_pvt.sata_dwc_sactive_issued | sactive) ^ sactive;
+ sactive = core_scr_read(hsdev, SCR_ACTIVE);
+ tag_mask = (hsdev->sactive_issued | sactive) ^ sactive;
/* If no sactive issued and tag_mask is zero then this is not NCQ */
- if (host_pvt.sata_dwc_sactive_issued == 0 && tag_mask == 0) {
+ if (hsdev->sactive_issued == 0 && tag_mask == 0) {
if (ap->link.active_tag == ATA_TAG_POISON)
tag = 0;
else
@@ -656,22 +651,19 @@ DRVSTILLBUSY:
*/
/* process completed commands */
- sactive = core_scr_read(SCR_ACTIVE);
- tag_mask = (host_pvt.sata_dwc_sactive_issued | sactive) ^ sactive;
+ sactive = core_scr_read(hsdev, SCR_ACTIVE);
+ tag_mask = (hsdev->sactive_issued | sactive) ^ sactive;
- if (sactive != 0 || (host_pvt.sata_dwc_sactive_issued) > 1 || \
- tag_mask > 1) {
+ if (sactive != 0 || hsdev->sactive_issued > 1 || tag_mask > 1) {
dev_dbg(ap->dev,
"%s NCQ:sactive=0x%08x sactive_issued=0x%08x tag_mask=0x%08x\n",
- __func__, sactive, host_pvt.sata_dwc_sactive_issued,
- tag_mask);
+ __func__, sactive, hsdev->sactive_issued, tag_mask);
}
- if ((tag_mask | (host_pvt.sata_dwc_sactive_issued)) != \
- (host_pvt.sata_dwc_sactive_issued)) {
+ if ((tag_mask | hsdev->sactive_issued) != hsdev->sactive_issued) {
dev_warn(ap->dev,
- "Bad tag mask? sactive=0x%08x (host_pvt.sata_dwc_sactive_issued)=0x%08x tag_mask=0x%08x\n",
- sactive, host_pvt.sata_dwc_sactive_issued, tag_mask);
+ "Bad tag mask? sactive=0x%08x sactive_issued=0x%08x tag_mask=0x%08x\n",
+ sactive, hsdev->sactive_issued, tag_mask);
}
/* read just to clear ... not bad if currently still busy */
@@ -733,7 +725,7 @@ STILLBUSY:
* we were processing --we read status as part of processing a completed
* command).
*/
- sactive2 = core_scr_read(SCR_ACTIVE);
+ sactive2 = core_scr_read(hsdev, SCR_ACTIVE);
if (sactive2 != sactive) {
dev_dbg(ap->dev,
"More completed - sactive=0x%x sactive2=0x%x\n",
@@ -819,8 +811,9 @@ static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
u8 status = 0;
u32 mask = 0x0;
u8 tag = qc->tag;
+ struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
- host_pvt.sata_dwc_sactive_queued = 0;
+ hsdev->sactive_queued = 0;
dev_dbg(ap->dev, "%s checkstatus? %x\n", __func__, check_status);
if (hsdevp->dma_pending[tag] == SATA_DWC_DMA_PENDING_TX)
@@ -833,10 +826,8 @@ static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
/* clear active bit */
mask = (~(qcmd_tag_to_mask(tag)));
- host_pvt.sata_dwc_sactive_queued = (host_pvt.sata_dwc_sactive_queued) \
- & mask;
- host_pvt.sata_dwc_sactive_issued = (host_pvt.sata_dwc_sactive_issued) \
- & mask;
+ hsdev->sactive_queued = hsdev->sactive_queued & mask;
+ hsdev->sactive_issued = hsdev->sactive_issued & mask;
ata_qc_complete(qc);
return 0;
}
@@ -961,7 +952,7 @@ static int sata_dwc_port_start(struct ata_port *ap)
}
/* Clear any error bits before libata starts issuing commands */
- clear_serror();
+ clear_serror(hsdev);
ap->private_data = hsdevp;
dev_dbg(ap->dev, "%s: done\n", __func__);
return 0;
@@ -999,6 +990,7 @@ static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
{
unsigned long flags;
struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
+ struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
dev_dbg(ap->dev, "%s cmd(0x%02x): %s tag=%d\n", __func__, tf->command,
ata_get_cmd_descript(tf->command), tag);
@@ -1012,7 +1004,7 @@ static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
* managed SError register for the disk needs to be done before the
* task file is loaded.
*/
- clear_serror();
+ clear_serror(hsdev);
ata_sff_exec_command(ap, tf);
}
@@ -1065,7 +1057,7 @@ static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag)
sata_dwc_tf_dump(ap, &qc->tf);
if (start_dma) {
- reg = core_scr_read(SCR_ERROR);
+ reg = core_scr_read(hsdev, SCR_ERROR);
if (reg & SATA_DWC_SERROR_ERR_BITS) {
dev_err(ap->dev, "%s: ****** SError=0x%08x ******\n",
__func__, reg);
@@ -1128,6 +1120,7 @@ static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
u32 sactive;
u8 tag = qc->tag;
struct ata_port *ap = qc->ap;
+ struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
#ifdef DEBUG_NCQ
if (qc->tag > 0 || ap->link.sactive > 1)
@@ -1144,9 +1137,9 @@ static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
sata_dwc_qc_prep_by_tag(qc, tag);
if (ata_is_ncq(qc->tf.protocol)) {
- sactive = core_scr_read(SCR_ACTIVE);
+ sactive = core_scr_read(hsdev, SCR_ACTIVE);
sactive |= (0x00000001 << tag);
- core_scr_write(SCR_ACTIVE, sactive);
+ core_scr_write(hsdev, SCR_ACTIVE, sactive);
dev_dbg(qc->ap->dev,
"%s: tag=%d ap->link.sactive = 0x%08x sactive=0x%08x\n",
@@ -1289,7 +1282,6 @@ static int sata_dwc_probe(struct platform_device *ofdev)
/* Setup port */
host->ports[0]->ioaddr.cmd_addr = base;
host->ports[0]->ioaddr.scr_addr = base + SATA_DWC_SCR_OFFSET;
- host_pvt.scr_addr_sstatus = base + SATA_DWC_SCR_OFFSET;
sata_dwc_setup_port(&host->ports[0]->ioaddr, (unsigned long)base);
/* Read the ID and Version Registers */
--
2.6.3
Mans Rullgard <[email protected]> writes:
> Currently this driver only works with a DesignWare DMA engine which it
> registers manually using the second "reg" address range and interrupt
> number from the DT node.
>
> This patch makes the driver instead use the "dmas" property if present,
> otherwise optionally falling back on the old way so existing device
> trees can continue to work.
>
> With this change, there is no longer any reason to depend on the 460EX
> machine type so drop that from Kconfig.
>
> Signed-off-by: Mans Rullgard <[email protected]>
> ---
> drivers/ata/Kconfig | 10 ++-
> drivers/ata/sata_dwc_460ex.c | 192 +++++++++++++++++++++++++++----------------
> 2 files changed, 131 insertions(+), 71 deletions(-)
The corresponding patch for the canyonlands devicetree looks something
like this. I don't have any such hardware or even a manual, so I don't
know what values to use for the various required DT properties of the
DMA controller node, nor can I test it. The SATA driver works with a
different DMA controller on a Sigma Designs chip.
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index 3dc75de..959f36e 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -190,12 +190,22 @@
/* DMA */ 0x2 &UIC0 0xc 0x4>;
};
+ DMA0: dma@bffd0800 {
+ compatible = "snps,dma-spear1340";
+ reg = <4 0xbffd0800 0x400>;
+ interrupt-parent = <&UIC3>;
+ interrupts = <0x5 0x4>;
+ #dma-cells = <3>;
+ /* required properties here */
+ };
+
SATA0: sata@bffd1000 {
compatible = "amcc,sata-460ex";
- reg = <4 0xbffd1000 0x800 4 0xbffd0800 0x400>;
+ reg = <4 0xbffd1000 0x800>;
interrupt-parent = <&UIC3>;
- interrupts = <0x0 0x4 /* SATA */
- 0x5 0x4>; /* AHBDMA */
+ interrupts = <0x0 0x4>;
+ dmas = <&DMA0 0 0 1>;
+ dma-names = "sata-dma";
};
POB0: opb {
--
M?ns Rullg?rd
Hello.
On 12/16/2015 2:25 AM, Mans Rullgard wrote:
> This adds support for powering on an optional PHY when activating the
> device.
>
> Signed-off-by: Mans Rullgard <[email protected]>
[...]
> diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
> index 9985749..d07aae1 100644
> --- a/drivers/ata/sata_dwc_460ex.c
> +++ b/drivers/ata/sata_dwc_460ex.c
[...]
> @@ -1318,6 +1320,21 @@ static int sata_dwc_probe(struct platform_device *ofdev)
> }
> #endif
>
> + hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy");
> + if (IS_ERR(hsdev->phy)) {
> + err = PTR_ERR(hsdev->phy);
> + hsdev->phy = NULL;
> + goto error_out;
> + }
> +
> + err = phy_init(hsdev->phy);
> + if (err)
> + goto error_out;
If phy_init() fails, do we really need to call phy_exit()?
> +
> + err = phy_power_on(hsdev->phy);
> + if (err)
> + goto error_out;
> +
> /*
> * Now, register with libATA core, this will also initiate the
> * device discovery process, invoking our port_start() handler &
> @@ -1331,6 +1348,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
> return 0;
>
> error_out:
> + phy_exit(hsdev->phy);
> iounmap(base);
> return err;
> }
[...]
MBR, Sergei
Sergei Shtylyov <[email protected]> writes:
> Hello.
>
> On 12/16/2015 2:25 AM, Mans Rullgard wrote:
>
>> This adds support for powering on an optional PHY when activating the
>> device.
>>
>> Signed-off-by: Mans Rullgard <[email protected]>
> [...]
>> diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
>> index 9985749..d07aae1 100644
>> --- a/drivers/ata/sata_dwc_460ex.c
>> +++ b/drivers/ata/sata_dwc_460ex.c
> [...]
>> @@ -1318,6 +1320,21 @@ static int sata_dwc_probe(struct platform_device *ofdev)
>> }
>> #endif
>>
>> + hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy");
>> + if (IS_ERR(hsdev->phy)) {
>> + err = PTR_ERR(hsdev->phy);
>> + hsdev->phy = NULL;
>> + goto error_out;
>> + }
>> +
>> + err = phy_init(hsdev->phy);
>> + if (err)
>> + goto error_out;
>
> If phy_init() fails, do we really need to call phy_exit()?
No, but it doesn't hurt either, and it makes the code slightly simpler.
I can change it though.
>> +
>> + err = phy_power_on(hsdev->phy);
>> + if (err)
>> + goto error_out;
>> +
>> /*
>> * Now, register with libATA core, this will also initiate the
>> * device discovery process, invoking our port_start() handler &
>> @@ -1331,6 +1348,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
>> return 0;
>>
>> error_out:
>> + phy_exit(hsdev->phy);
>> iounmap(base);
>> return err;
>> }
> [...]
>
> MBR, Sergei
>
--
M?ns Rullg?rd
On Tue, 2015-12-15 at 23:25 +0000, Mans Rullgard wrote:
> Currently this driver only works with a DesignWare DMA engine which
> it
> registers manually using the second "reg" address range and interrupt
> number from the DT node.
>
> This patch makes the driver instead use the "dmas" property if
> present,
> otherwise optionally falling back on the old way so existing device
> trees can continue to work.
>
> With this change, there is no longer any reason to depend on the
> 460EX
> machine type so drop that from Kconfig.
Looks good for me (from dw_dmac usage prospective).
>
> Signed-off-by: Mans Rullgard <[email protected]>
> ---
> drivers/ata/Kconfig | 10 ++-
> drivers/ata/sata_dwc_460ex.c | 192 +++++++++++++++++++++++++++----
> ------------
> 2 files changed, 131 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 3fc2a56..193c673 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -296,14 +296,20 @@ config ATA_PIIX
>
> config SATA_DWC
> tristate "DesignWare Cores SATA support"
> - depends on 460EX
> - select DW_DMAC
> help
> This option enables support for the on-chip SATA
> controller of the
> AppliedMicro processor 460EX.
>
> If unsure, say N.
>
> +config SATA_DWC_OLD_DMA
> + bool "Support old device trees"
> + depends on SATA_DWC && 460EX
> + select DW_DMAC
> + help
> + This option enables support for old device trees without
> the
> + "dmas" property.
> +
> config SATA_DWC_DEBUG
> bool "Debugging driver version"
> depends on SATA_DWC
> diff --git a/drivers/ata/sata_dwc_460ex.c
> b/drivers/ata/sata_dwc_460ex.c
> index 9020349..9985749 100644
> --- a/drivers/ata/sata_dwc_460ex.c
> +++ b/drivers/ata/sata_dwc_460ex.c
> @@ -30,6 +30,7 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/device.h>
> +#include <linux/dmaengine.h>
> #include <linux/of_address.h>
> #include <linux/of_irq.h>
> #include <linux/of_platform.h>
> @@ -42,10 +43,6 @@
> #include <scsi/scsi_host.h>
> #include <scsi/scsi_cmnd.h>
>
> -/* Supported DMA engine drivers */
> -#include <linux/platform_data/dma-dw.h>
> -#include <linux/dma/dw.h>
> -
> /* These two are defined in "libata.h" */
> #undef DRV_NAME
> #undef DRV_VERSION
> @@ -148,7 +145,9 @@ struct sata_dwc_device {
> struct ata_host *host;
> u8 __iomem *reg_base;
> struct sata_dwc_regs *sata_dwc_regs; /* DW
> Synopsys SATA specific */
> +#ifdef CONFIG_SATA_DWC_OLD_DMA
> struct dw_dma_chip *dma;
> +#endif
> };
>
> #define SATA_DWC_QCMD_MAX 32
> @@ -159,7 +158,6 @@ struct sata_dwc_device_port {
> int dma_pending[SATA_DWC_QCMD_MAX];
>
> /* DMA info */
> - struct dw_dma_slave *dws;
> struct dma_chan *chan;
> struct dma_async_tx_descriptor *desc[SATA_DWC_QCMD_MA
> X];
> u32 dma_interrupt_count;
> @@ -198,13 +196,6 @@ struct sata_dwc_host_priv {
>
> static struct sata_dwc_host_priv host_pvt;
>
> -static struct dw_dma_slave sata_dwc_dma_dws = {
> - .src_id = 0,
> - .dst_id = 0,
> - .src_master = 0,
> - .dst_master = 1,
> -};
> -
> /*
> * Prototypes
> */
> @@ -215,6 +206,90 @@ static void sata_dwc_dma_xfer_complete(struct
> ata_port *ap, u32 check_status);
> static void sata_dwc_port_stop(struct ata_port *ap);
> static void sata_dwc_clear_dmacr(struct sata_dwc_device_port
> *hsdevp, u8 tag);
>
> +#ifdef CONFIG_SATA_DWC_OLD_DMA
> +
> +#include <linux/platform_data/dma-dw.h>
> +#include <linux/dma/dw.h>
> +
> +static struct dw_dma_slave sata_dwc_dma_dws = {
> + .src_id = 0,
> + .dst_id = 0,
> + .src_master = 0,
> + .dst_master = 1,
> +};
> +
> +static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
> +{
> + struct dw_dma_slave *dws = &sata_dwc_dma_dws;
> +
> + if (dws->dma_dev != chan->device->dev)
> + return false;
> +
> + chan->private = dws;
> + return true;
> +}
> +
> +static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port
> *hsdevp)
> +{
> + struct sata_dwc_device *hsdev = hsdevp->hsdev;
> + struct dw_dma_slave *dws = &sata_dwc_dma_dws;
> + dma_cap_mask_t mask;
> +
> + dws->dma_dev = hsdev->dev;
> +
> + dma_cap_zero(mask);
> + dma_cap_set(DMA_SLAVE, mask);
> +
> + /* Acquire DMA channel */
> + hsdevp->chan = dma_request_channel(mask,
> sata_dwc_dma_filter, hsdevp);
> + if (!hsdevp->chan) {
> + dev_err(hsdev->dev, "%s: dma channel unavailable\n",
> + __func__);
> + return -EAGAIN;
> + }
> +
> + return 0;
> +}
> +
> +static int sata_dwc_dma_init_old(struct platform_device *pdev,
> + struct sata_dwc_device *hsdev)
> +{
> + struct device_node *np = pdev->dev.of_node;
> + int err;
> +
> + hsdev->dma = devm_kzalloc(&pdev->dev, sizeof(*hsdev->dma),
> GFP_KERNEL);
> + if (!hsdev->dma)
> + return -ENOMEM;
> +
> + hsdev->dma->dev = &pdev->dev;
> +
> + /* Get SATA DMA interrupt number */
> + hsdev->dma->irq = irq_of_parse_and_map(np, 1);
> + if (hsdev->dma->irq == NO_IRQ) {
> + dev_err(&pdev->dev, "no SATA DMA irq\n");
> + return -ENODEV;
> + }
> +
> + /* Get physical SATA DMA register base address */
> + hsdev->dma->regs = of_iomap(np, 1);
> + if (!hsdev->dma->regs) {
> + dev_err(&pdev->dev,
> + "ioremap failed for AHBDMA register
> address\n");
> + return -ENODEV;
> + }
> +
> + /* Initialize AHB DMAC */
> + err = dw_dma_probe(hsdev->dma, NULL);
> + if (err) {
> + iounmap(hsdev->dma->regs);
> + return err;
> + }
> +
> + return 0;
> +}
> +
> +#endif
> +
> static const char *get_prot_descript(u8 protocol)
> {
> switch ((enum ata_tf_protocols)protocol) {
> @@ -783,18 +858,6 @@ static void sata_dwc_enable_interrupts(struct
> sata_dwc_device *hsdev)
> in_le32(&hsdev->sata_dwc_regs->errmr));
> }
>
> -static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
> -{
> - struct sata_dwc_device_port *hsdevp = param;
> - struct dw_dma_slave *dws = hsdevp->dws;
> -
> - if (dws->dma_dev != chan->device->dev)
> - return false;
> -
> - chan->private = dws;
> - return true;
> -}
> -
> static void sata_dwc_setup_port(struct ata_ioports *port, unsigned
> long base)
> {
> port->cmd_addr = (void __iomem *)base + 0x00;
> @@ -817,6 +880,26 @@ static void sata_dwc_setup_port(struct
> ata_ioports *port, unsigned long base)
> port->ctl_addr = (void __iomem *)base + 0x20;
> }
>
> +static int sata_dwc_dma_get_channel(struct sata_dwc_device_port
> *hsdevp)
> +{
> + struct sata_dwc_device *hsdev = hsdevp->hsdev;
> + struct device *dev = hsdev->dev;
> +
> +#ifdef CONFIG_SATA_DWC_OLD_DMA
> + if (!of_find_property(dev->of_node, "dmas", NULL))
> + return sata_dwc_dma_get_channel_old(hsdevp);
> +#endif
> +
> + hsdevp->chan = dma_request_slave_channel(dev, "sata-dma");
> + if (IS_ERR(hsdevp->chan)) {
> + dev_err(dev, "failed to allocate dma channel:
> %ld\n",
> + PTR_ERR(hsdevp->chan));
> + return PTR_ERR(hsdevp->chan);
> + }
> +
> + return 0;
> +}
> +
> /*
> * Function : sata_dwc_port_start
> * arguments : struct ata_ioports *port
> @@ -829,7 +912,6 @@ static int sata_dwc_port_start(struct ata_port
> *ap)
> struct sata_dwc_device *hsdev;
> struct sata_dwc_device_port *hsdevp = NULL;
> struct device *pdev;
> - dma_cap_mask_t mask;
> int i;
>
> hsdev = HSDEV_FROM_AP(ap);
> @@ -853,20 +935,9 @@ static int sata_dwc_port_start(struct ata_port
> *ap)
> }
> hsdevp->hsdev = hsdev;
>
> - hsdevp->dws = &sata_dwc_dma_dws;
> - hsdevp->dws->dma_dev = hsdev->dev;
> -
> - dma_cap_zero(mask);
> - dma_cap_set(DMA_SLAVE, mask);
> -
> - /* Acquire DMA channel */
> - hsdevp->chan = dma_request_channel(mask,
> sata_dwc_dma_filter, hsdevp);
> - if (!hsdevp->chan) {
> - dev_err(hsdev->dev, "%s: dma channel unavailable\n",
> - __func__);
> - err = -EAGAIN;
> + err = sata_dwc_dma_get_channel(hsdevp);
> + if (err)
> goto CLEANUP_ALLOC;
> - }
>
> for (i = 0; i < SATA_DWC_QCMD_MAX; i++)
> hsdevp->cmd_issued[i] = SATA_DWC_CMD_ISSUED_NOT;
> @@ -1225,33 +1296,9 @@ static int sata_dwc_probe(struct
> platform_device *ofdev)
> dev_notice(&ofdev->dev, "id %d, controller version
> %c.%c%c\n",
> idr, ver[0], ver[1], ver[2]);
>
> - /* Get SATA DMA interrupt number */
> - hsdev->dma->irq = irq_of_parse_and_map(np, 1);
> - if (hsdev->dma->irq == NO_IRQ) {
> - dev_err(&ofdev->dev, "no SATA DMA irq\n");
> - err = -ENODEV;
> - goto error_iomap;
> - }
> -
> - /* Get physical SATA DMA register base address */
> - hsdev->dma->regs = of_iomap(np, 1);
> - if (!hsdev->dma->regs) {
> - dev_err(&ofdev->dev,
> - "ioremap failed for AHBDMA register
> address\n");
> - err = -ENODEV;
> - goto error_iomap;
> - }
> -
> /* Save dev for later use in dev_xxx() routines */
> hsdev->dev = &ofdev->dev;
>
> - hsdev->dma->dev = &ofdev->dev;
> -
> - /* Initialize AHB DMAC */
> - err = dw_dma_probe(hsdev->dma, NULL);
> - if (err)
> - goto error_dma_iomap;
> -
> /* Enable SATA Interrupts */
> sata_dwc_enable_interrupts(hsdev);
>
> @@ -1263,6 +1310,14 @@ static int sata_dwc_probe(struct
> platform_device *ofdev)
> goto error_out;
> }
>
> +#ifdef CONFIG_SATA_DWC_OLD_DMA
> + if (!of_find_property(np, "dmas", NULL)) {
> + err = sata_dwc_dma_init_old(ofdev, hsdev);
> + if (err)
> + goto error_out;
> + }
> +#endif
> +
> /*
> * Now, register with libATA core, this will also initiate
> the
> * device discovery process, invoking our port_start()
> handler &
> @@ -1276,11 +1331,6 @@ static int sata_dwc_probe(struct
> platform_device *ofdev)
> return 0;
>
> error_out:
> - /* Free SATA DMA resources */
> - dw_dma_remove(hsdev->dma);
> -error_dma_iomap:
> - iounmap(hsdev->dma->regs);
> -error_iomap:
> iounmap(base);
> return err;
> }
> @@ -1293,10 +1343,14 @@ static int sata_dwc_remove(struct
> platform_device *ofdev)
>
> ata_host_detach(host);
>
> +#ifdef CONFIG_SATA_DWC_OLD_DMA
> /* Free SATA DMA resources */
> - dw_dma_remove(hsdev->dma);
> + if (hsdev->dma) {
> + dw_dma_remove(hsdev->dma);
> + iounmap(hsdev->dma->regs);
> + }
> +#endif
>
> - iounmap(hsdev->dma->regs);
> iounmap(hsdev->reg_base);
> dev_dbg(&ofdev->dev, "done\n");
> return 0;
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On Tue, 2015-12-15 at 23:34 +0000, Måns Rullgård wrote:
> Mans Rullgard <[email protected]> writes:
>
> > Currently this driver only works with a DesignWare DMA engine which
> > it
> > registers manually using the second "reg" address range and
> > interrupt
> > number from the DT node.
> >
> > This patch makes the driver instead use the "dmas" property if
> > present,
> > otherwise optionally falling back on the old way so existing device
> > trees can continue to work.
> >
> > With this change, there is no longer any reason to depend on the
> > 460EX
> > machine type so drop that from Kconfig.
> >
> > Signed-off-by: Mans Rullgard <[email protected]>
> > ---
> > drivers/ata/Kconfig | 10 ++-
> > drivers/ata/sata_dwc_460ex.c | 192 +++++++++++++++++++++++++++--
> > --------------
> > 2 files changed, 131 insertions(+), 71 deletions(-)
>
> The corresponding patch for the canyonlands devicetree looks
> something
> like this. I don't have any such hardware or even a manual, so I
> don't
> know what values to use for the various required DT properties of the
> DMA controller node, nor can I test it. The SATA driver works with a
> different DMA controller on a Sigma Designs chip.
>
> diff --git a/arch/powerpc/boot/dts/canyonlands.dts
> b/arch/powerpc/boot/dts/canyonlands.dts
> index 3dc75de..959f36e 100644
> --- a/arch/powerpc/boot/dts/canyonlands.dts
> +++ b/arch/powerpc/boot/dts/canyonlands.dts
> @@ -190,12 +190,22 @@
> /* DMA */ 0x2 &UIC0 0xc
> 0x4>;
> };
>
> + DMA0: dma@bffd0800 {
> + compatible = "snps,dma-spear1340";
> + reg = <4 0xbffd0800 0x400>;
> + interrupt-parent = <&UIC3>;
> + interrupts = <0x5 0x4>;
> + #dma-cells = <3>;
> + /* required properties here */
You have to move the master assignments and other custom dw_dmac
properties. Maybe at some point I will fix that in dw/platform.c.
> + };
> +
> SATA0: sata@bffd1000 {
> compatible = "amcc,sata-460ex";
> - reg = <4 0xbffd1000 0x800 4 0xbffd0800
> 0x400>;
> + reg = <4 0xbffd1000 0x800>;
> interrupt-parent = <&UIC3>;
> - interrupts = <0x0 0x4 /* SATA */
> - 0x5 0x4>; /* AHBDMA */
> + interrupts = <0x0 0x4>;
> + dmas = <&DMA0 0 0 1>;
> + dma-names = "sata-dma";
> };
>
> POB0: opb {
>
>
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On Tue, 2015-12-15 at 23:25 +0000, Mans Rullgard wrote:
> This moves all global data into the driver private struct, thus
> permitting multiple devices of this type to be used.
>
Nice!
Btw, last time Linus complained about new warnings. Most of them I have
fixed when moved to external DMA driver. Leftovers IIRC are related to
address space. Are you going to fix them? Otherwise it might be a
headache for him again with strong wording to our address I suppose.
> Signed-off-by: Mans Rullgard <[email protected]>
> ---
> drivers/ata/sata_dwc_460ex.c | 80 ++++++++++++++++++++------------
> ------------
> 1 file changed, 36 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/ata/sata_dwc_460ex.c
> b/drivers/ata/sata_dwc_460ex.c
> index d07aae1..919f870 100644
> --- a/drivers/ata/sata_dwc_460ex.c
> +++ b/drivers/ata/sata_dwc_460ex.c
> @@ -146,6 +146,8 @@ struct sata_dwc_device {
> struct ata_host *host;
> u8 __iomem *reg_base;
> struct sata_dwc_regs *sata_dwc_regs; /* DW
> Synopsys SATA specific */
> + u32 sactive_issued;
> + u32 sactive_queued;
> struct phy *phy;
> #ifdef CONFIG_SATA_DWC_OLD_DMA
> struct dw_dma_chip *dma;
> @@ -190,14 +192,6 @@ enum {
> SATA_DWC_DMA_PENDING_RX = 2,
> };
>
> -struct sata_dwc_host_priv {
> - void __iomem *scr_addr_sstatus;
> - u32 sata_dwc_sactive_issued ;
> - u32 sata_dwc_sactive_queued ;
> -};
> -
> -static struct sata_dwc_host_priv host_pvt;
> -
> /*
> * Prototypes
> */
> @@ -448,21 +442,22 @@ static int sata_dwc_scr_write(struct ata_link
> *link, unsigned int scr, u32 val)
> return 0;
> }
>
> -static u32 core_scr_read(unsigned int scr)
> +static u32 core_scr_read(struct sata_dwc_device *hsdev, unsigned int
> scr)
> {
> - return in_le32(host_pvt.scr_addr_sstatus + (scr * 4));
> + return in_le32(hsdev->reg_base + SATA_DWC_SCR_OFFSET + (scr
> * 4));
> }
>
> -static void core_scr_write(unsigned int scr, u32 val)
> +static void core_scr_write(struct sata_dwc_device *hsdev, unsigned
> int scr,
> + u32 val)
> {
> - out_le32(host_pvt.scr_addr_sstatus + (scr * 4), val);
> + out_le32(hsdev->reg_base + SATA_DWC_SCR_OFFSET + (scr * 4),
> val);
> }
>
> -static void clear_serror(void)
> +static void clear_serror(struct sata_dwc_device *hsdev)
> {
> u32 val;
> - val = core_scr_read(SCR_ERROR);
> - core_scr_write(SCR_ERROR, val);
> + val = core_scr_read(hsdev, SCR_ERROR);
> + core_scr_write(hsdev, SCR_ERROR, val);
> }
>
> static void clear_interrupt_bit(struct sata_dwc_device *hsdev, u32
> bit)
> @@ -489,7 +484,7 @@ static void sata_dwc_error_intr(struct ata_port
> *ap,
>
> ata_ehi_clear_desc(ehi);
>
> - serror = core_scr_read(SCR_ERROR);
> + serror = core_scr_read(hsdev, SCR_ERROR);
> status = ap->ops->sff_check_status(ap);
>
> tag = ap->link.active_tag;
> @@ -500,7 +495,7 @@ static void sata_dwc_error_intr(struct ata_port
> *ap,
> hsdevp->dma_pending[tag], hsdevp->cmd_issued[tag]);
>
> /* Clear error register and interrupt bit */
> - clear_serror();
> + clear_serror(hsdev);
> clear_interrupt_bit(hsdev, SATA_DWC_INTPR_ERR);
>
> /* This is the only error happening now. TODO check for
> exact error */
> @@ -539,7 +534,7 @@ static irqreturn_t sata_dwc_isr(int irq, void
> *dev_instance)
> int handled, num_processed, port = 0;
> uint intpr, sactive, sactive2, tag_mask;
> struct sata_dwc_device_port *hsdevp;
> - host_pvt.sata_dwc_sactive_issued = 0;
> + hsdev->sactive_issued = 0;
>
> spin_lock_irqsave(&host->lock, flags);
>
> @@ -568,7 +563,7 @@ static irqreturn_t sata_dwc_isr(int irq, void
> *dev_instance)
> if (hsdevp->cmd_issued[tag] !=
> SATA_DWC_CMD_ISSUED_PEND)
> dev_warn(ap->dev, "CMD tag=%d not
> pending?\n", tag);
>
> - host_pvt.sata_dwc_sactive_issued |=
> qcmd_tag_to_mask(tag);
> + hsdev->sactive_issued |= qcmd_tag_to_mask(tag);
>
> qc = ata_qc_from_tag(ap, tag);
> /*
> @@ -582,11 +577,11 @@ static irqreturn_t sata_dwc_isr(int irq, void
> *dev_instance)
> handled = 1;
> goto DONE;
> }
> - sactive = core_scr_read(SCR_ACTIVE);
> - tag_mask = (host_pvt.sata_dwc_sactive_issued | sactive) ^
> sactive;
> + sactive = core_scr_read(hsdev, SCR_ACTIVE);
> + tag_mask = (hsdev->sactive_issued | sactive) ^ sactive;
>
> /* If no sactive issued and tag_mask is zero then this is
> not NCQ */
> - if (host_pvt.sata_dwc_sactive_issued == 0 && tag_mask == 0)
> {
> + if (hsdev->sactive_issued == 0 && tag_mask == 0) {
> if (ap->link.active_tag == ATA_TAG_POISON)
> tag = 0;
> else
> @@ -656,22 +651,19 @@ DRVSTILLBUSY:
> */
>
> /* process completed commands */
> - sactive = core_scr_read(SCR_ACTIVE);
> - tag_mask = (host_pvt.sata_dwc_sactive_issued | sactive) ^
> sactive;
> + sactive = core_scr_read(hsdev, SCR_ACTIVE);
> + tag_mask = (hsdev->sactive_issued | sactive) ^ sactive;
>
> - if (sactive != 0 || (host_pvt.sata_dwc_sactive_issued) > 1
> || \
> - tag_mask >
> 1) {
> + if (sactive != 0 || hsdev->sactive_issued > 1 || tag_mask >
> 1) {
> dev_dbg(ap->dev,
> "%s
> NCQ:sactive=0x%08x sactive_issued=0x%08x tag_mask=0x%08x\n",
> - __func__, sactive,
> host_pvt.sata_dwc_sactive_issued,
> - tag_mask);
> + __func__, sactive, hsdev->sactive_issued,
> tag_mask);
> }
>
> - if ((tag_mask | (host_pvt.sata_dwc_sactive_issued)) != \
> - (host_pvt.sata_dwc_sactive_i
> ssued)) {
> + if ((tag_mask | hsdev->sactive_issued) != hsdev-
> >sactive_issued) {
> dev_warn(ap->dev,
> - "Bad tag mask? sactive=0x%08x
> (host_pvt.sata_dwc_sactive_issued)=0x%08x tag_mask=0x%08x\n",
> - sactive, host_pvt.sata_dwc_sactive_issued,
> tag_mask);
> + "Bad tag mask? sactive=0x%08x
> sactive_issued=0x%08x tag_mask=0x%08x\n",
> + sactive, hsdev->sactive_issued, tag_mask);
> }
>
> /* read just to clear ... not bad if currently still busy */
> @@ -733,7 +725,7 @@ STILLBUSY:
> * we were processing --we read status as part of processing
> a completed
> * command).
> */
> - sactive2 = core_scr_read(SCR_ACTIVE);
> + sactive2 = core_scr_read(hsdev, SCR_ACTIVE);
> if (sactive2 != sactive) {
> dev_dbg(ap->dev,
> "More completed - sactive=0x%x
> sactive2=0x%x\n",
> @@ -819,8 +811,9 @@ static int sata_dwc_qc_complete(struct ata_port
> *ap, struct ata_queued_cmd *qc,
> u8 status = 0;
> u32 mask = 0x0;
> u8 tag = qc->tag;
> + struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
> struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
> - host_pvt.sata_dwc_sactive_queued = 0;
> + hsdev->sactive_queued = 0;
> dev_dbg(ap->dev, "%s checkstatus? %x\n", __func__,
> check_status);
>
> if (hsdevp->dma_pending[tag] == SATA_DWC_DMA_PENDING_TX)
> @@ -833,10 +826,8 @@ static int sata_dwc_qc_complete(struct ata_port
> *ap, struct ata_queued_cmd *qc,
>
> /* clear active bit */
> mask = (~(qcmd_tag_to_mask(tag)));
> - host_pvt.sata_dwc_sactive_queued =
> (host_pvt.sata_dwc_sactive_queued) \
> - & mask;
> - host_pvt.sata_dwc_sactive_issued =
> (host_pvt.sata_dwc_sactive_issued) \
> - & mask;
> + hsdev->sactive_queued = hsdev->sactive_queued & mask;
> + hsdev->sactive_issued = hsdev->sactive_issued & mask;
> ata_qc_complete(qc);
> return 0;
> }
> @@ -961,7 +952,7 @@ static int sata_dwc_port_start(struct ata_port
> *ap)
> }
>
> /* Clear any error bits before libata starts issuing
> commands */
> - clear_serror();
> + clear_serror(hsdev);
> ap->private_data = hsdevp;
> dev_dbg(ap->dev, "%s: done\n", __func__);
> return 0;
> @@ -999,6 +990,7 @@ static void sata_dwc_exec_command_by_tag(struct
> ata_port *ap,
> {
> unsigned long flags;
> struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
> + struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
>
> dev_dbg(ap->dev, "%s cmd(0x%02x): %s tag=%d\n", __func__,
> tf->command,
> ata_get_cmd_descript(tf->command), tag);
> @@ -1012,7 +1004,7 @@ static void sata_dwc_exec_command_by_tag(struct
> ata_port *ap,
> * managed SError register for the disk needs to be done
> before the
> * task file is loaded.
> */
> - clear_serror();
> + clear_serror(hsdev);
> ata_sff_exec_command(ap, tf);
> }
>
> @@ -1065,7 +1057,7 @@ static void sata_dwc_bmdma_start_by_tag(struct
> ata_queued_cmd *qc, u8 tag)
> sata_dwc_tf_dump(ap, &qc->tf);
>
> if (start_dma) {
> - reg = core_scr_read(SCR_ERROR);
> + reg = core_scr_read(hsdev, SCR_ERROR);
> if (reg & SATA_DWC_SERROR_ERR_BITS) {
> dev_err(ap->dev, "%s: ****** SError=0x%08x
> ******\n",
> __func__, reg);
> @@ -1128,6 +1120,7 @@ static unsigned int sata_dwc_qc_issue(struct
> ata_queued_cmd *qc)
> u32 sactive;
> u8 tag = qc->tag;
> struct ata_port *ap = qc->ap;
> + struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
>
> #ifdef DEBUG_NCQ
> if (qc->tag > 0 || ap->link.sactive > 1)
> @@ -1144,9 +1137,9 @@ static unsigned int sata_dwc_qc_issue(struct
> ata_queued_cmd *qc)
> sata_dwc_qc_prep_by_tag(qc, tag);
>
> if (ata_is_ncq(qc->tf.protocol)) {
> - sactive = core_scr_read(SCR_ACTIVE);
> + sactive = core_scr_read(hsdev, SCR_ACTIVE);
> sactive |= (0x00000001 << tag);
> - core_scr_write(SCR_ACTIVE, sactive);
> + core_scr_write(hsdev, SCR_ACTIVE, sactive);
>
> dev_dbg(qc->ap->dev,
> "%s: tag=%d ap->link.sactive = 0x%08x
> sactive=0x%08x\n",
> @@ -1289,7 +1282,6 @@ static int sata_dwc_probe(struct
> platform_device *ofdev)
> /* Setup port */
> host->ports[0]->ioaddr.cmd_addr = base;
> host->ports[0]->ioaddr.scr_addr = base +
> SATA_DWC_SCR_OFFSET;
> - host_pvt.scr_addr_sstatus = base + SATA_DWC_SCR_OFFSET;
> sata_dwc_setup_port(&host->ports[0]->ioaddr, (unsigned
> long)base);
>
> /* Read the ID and Version Registers */
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Andy Shevchenko <[email protected]> writes:
> On Tue, 2015-12-15 at 23:34 +0000, M?ns Rullg?rd wrote:
>> Mans Rullgard <[email protected]> writes:
>>
>> > Currently this driver only works with a DesignWare DMA engine which
>> > it
>> > registers manually using the second "reg" address range and
>> > interrupt
>> > number from the DT node.
>> >
>> > This patch makes the driver instead use the "dmas" property if
>> > present,
>> > otherwise optionally falling back on the old way so existing device
>> > trees can continue to work.
>> >
>> > With this change, there is no longer any reason to depend on the
>> > 460EX
>> > machine type so drop that from Kconfig.
>> >
>> > Signed-off-by: Mans Rullgard <[email protected]>
>> > ---
>> > ?drivers/ata/Kconfig??????????|??10 ++-
>> > ?drivers/ata/sata_dwc_460ex.c | 192 +++++++++++++++++++++++++++--
>> > --------------
>> > ?2 files changed, 131 insertions(+), 71 deletions(-)
>>
>> The corresponding patch for the canyonlands devicetree looks
>> something
>> like this.??I don't have any such hardware or even a manual, so I
>> don't
>> know what values to use for the various required DT properties of the
>> DMA controller node, nor can I test it.??The SATA driver works with a
>> different DMA controller on a Sigma Designs chip.
>>
>> diff --git a/arch/powerpc/boot/dts/canyonlands.dts
>> b/arch/powerpc/boot/dts/canyonlands.dts
>> index 3dc75de..959f36e 100644
>> --- a/arch/powerpc/boot/dts/canyonlands.dts
>> +++ b/arch/powerpc/boot/dts/canyonlands.dts
>> @@ -190,12 +190,22 @@
>> ? ?/* DMA */ 0x2 &UIC0 0xc
>> 0x4>;
>> ? };
>> ?
>> + DMA0: dma@bffd0800 {
>> + compatible = "snps,dma-spear1340";
>> + reg = <4 0xbffd0800 0x400>;
>> + interrupt-parent = <&UIC3>;
>> + interrupts = <0x5 0x4>;
>> + #dma-cells = <3>;
>> + /* required properties here */
>
> You have to move the master assignments and other custom dw_dmac
> properties. Maybe at some point I will fix that in dw/platform.c.
>
>> + };
The current sata_dwc driver calls dw_dma_probe() with null pdata which
causes the dw_dma driver to auto-detect most parameters. It looks like
simply omitting those properties here results in the same thing,
although in this case dw_dma_parse_dt() leaves a devm-allocated pdata
struct adrift. Deferring the allocation of that and changing the DT
binding doc to make these properties optional for auto-detect-capable
hardware should just work. Something like this:
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 68a4815..f90c465 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -103,18 +103,21 @@ dw_dma_parse_dt(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct dw_dma_platform_data *pdata;
u32 tmp, arr[DW_DMA_MAX_NR_MASTERS];
+ u32 nr_channels;
if (!np) {
dev_err(&pdev->dev, "Missing DT data\n");
return NULL;
}
+ if (of_property_read_u32(np, "dma-channels", nr_channels))
+ return NULL;
+
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return NULL;
- if (of_property_read_u32(np, "dma-channels", &pdata->nr_channels))
- return NULL;
+ pdata->nr_channels = nr_channels;
if (of_property_read_bool(np, "is_private"))
pdata->is_private = true;
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
> On Tue, 2015-12-15 at 23:25 +0000, Mans Rullgard wrote:
>> This moves all global data into the driver private struct, thus
>> permitting multiple devices of this type to be used.
>>
>
> Nice!
>
> Btw, last time Linus complained about new warnings. Most of them I have
> fixed when moved to external DMA driver. Leftovers IIRC are related to
> address space. Are you going to fix them? Otherwise it might be a
> headache for him again with strong wording to our address I suppose.
There are some issues with __iomem annotations. Is that the warnings
you refer to? I'm not getting any regular compiler warnings.
--
M?ns Rullg?rd
On Thu, 2015-12-17 at 15:19 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > On Tue, 2015-12-15 at 23:25 +0000, Mans Rullgard wrote:
> > > This moves all global data into the driver private struct, thus
> > > permitting multiple devices of this type to be used.
> > >
> >
> > Nice!
> >
> > Btw, last time Linus complained about new warnings. Most of them I
> > have
> > fixed when moved to external DMA driver. Leftovers IIRC are related
> > to
> > address space. Are you going to fix them? Otherwise it might be a
> > headache for him again with strong wording to our address I
> > suppose.
>
> There are some issues with __iomem annotations. Is that the warnings
> you refer to? I'm not getting any regular compiler warnings.
>
I guess I got them because I'am checking sparse warnings as well.
There is the original Linus' complain.
http://permalink.gmane.org/gmane.linux.ide/59391
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On Thu, 2015-12-17 at 15:13 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > On Tue, 2015-12-15 at 23:34 +0000, Måns Rullgård wrote:
> > > Mans Rullgard <[email protected]> writes:
> > >
> > > > Currently this driver only works with a DesignWare DMA engine
> > > > which
> > > > it
> > > > registers manually using the second "reg" address range and
> > > > interrupt
> > > > number from the DT node.
> > > >
> > > > This patch makes the driver instead use the "dmas" property if
> > > > present,
> > > > otherwise optionally falling back on the old way so existing
> > > > device
> > > > trees can continue to work.
> > > >
> > > > With this change, there is no longer any reason to depend on
> > > > the
> > > > 460EX
> > > > machine type so drop that from Kconfig.
> > > >
> > > > Signed-off-by: Mans Rullgard <[email protected]>
> > > > ---
> > > > drivers/ata/Kconfig | 10 ++-
> > > > drivers/ata/sata_dwc_460ex.c | 192
> > > > +++++++++++++++++++++++++++--
> > > > --------------
> > > > 2 files changed, 131 insertions(+), 71 deletions(-)
> > >
> > > The corresponding patch for the canyonlands devicetree looks
> > > something
> > > like this. I don't have any such hardware or even a manual, so I
> > > don't
> > > know what values to use for the various required DT properties of
> > > the
> > > DMA controller node, nor can I test it. The SATA driver works
> > > with a
> > > different DMA controller on a Sigma Designs chip.
> > >
> > > diff --git a/arch/powerpc/boot/dts/canyonlands.dts
> > > b/arch/powerpc/boot/dts/canyonlands.dts
> > > index 3dc75de..959f36e 100644
> > > --- a/arch/powerpc/boot/dts/canyonlands.dts
> > > +++ b/arch/powerpc/boot/dts/canyonlands.dts
> > > @@ -190,12 +190,22 @@
> > > /* DMA */ 0x2 &UIC0 0xc
> > > 0x4>;
> > > };
> > >
> > > + DMA0: dma@bffd0800 {
> > > + compatible = "snps,dma-spear1340";
> > > + reg = <4 0xbffd0800 0x400>;
> > > + interrupt-parent = <&UIC3>;
> > > + interrupts = <0x5 0x4>;
> > > + #dma-cells = <3>;
> > > + /* required properties here */
> >
> > You have to move the master assignments and other custom dw_dmac
> > properties. Maybe at some point I will fix that in dw/platform.c.
> >
> > > + };
>
> The current sata_dwc driver calls dw_dma_probe() with null pdata
> which
> causes the dw_dma driver to auto-detect most parameters. It looks
> like
> simply omitting those properties here results in the same thing,
> although in this case dw_dma_parse_dt() leaves a devm-allocated pdata
> struct adrift. Deferring the allocation of that and changing the DT
> binding doc to make these properties optional for auto-detect-capable
> hardware should just work.
Yeah, I would like to allow autoconfiguration in case of DT as well and
translate it to use unified device property API.
> Something like this:
If it works for you, please, submit as a patch. Thanks.
>
> diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> index 68a4815..f90c465 100644
> --- a/drivers/dma/dw/platform.c
> +++ b/drivers/dma/dw/platform.c
> @@ -103,18 +103,21 @@ dw_dma_parse_dt(struct platform_device *pdev)
> struct device_node *np = pdev->dev.of_node;
> struct dw_dma_platform_data *pdata;
> u32 tmp, arr[DW_DMA_MAX_NR_MASTERS];
> + u32 nr_channels;
>
> if (!np) {
> dev_err(&pdev->dev, "Missing DT data\n");
> return NULL;
> }
>
> + if (of_property_read_u32(np, "dma-channels", nr_channels))
> + return NULL;
> +
> pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata),
> GFP_KERNEL);
> if (!pdata)
> return NULL;
>
> - if (of_property_read_u32(np, "dma-channels", &pdata-
> >nr_channels))
> - return NULL;
> + pdata->nr_channels = nr_channels;
>
> if (of_property_read_bool(np, "is_private"))
> pdata->is_private = true;
>
>
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Andy Shevchenko <[email protected]> writes:
> On Thu, 2015-12-17 at 15:19 +0000, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>> > On Tue, 2015-12-15 at 23:25 +0000, Mans Rullgard wrote:
>> > > This moves all global data into the driver private struct, thus
>> > > permitting multiple devices of this type to be used.
>> > >
>> >
>> > Nice!
>> >
>> > Btw, last time Linus complained about new warnings. Most of them I
>> > have
>> > fixed when moved to external DMA driver. Leftovers IIRC are related
>> > to
>> > address space. Are you going to fix them? Otherwise it might be a
>> > headache for him again with strong wording to our address I
>> > suppose.
>>
>> There are some issues with __iomem annotations.??Is that the warnings
>> you refer to???I'm not getting any regular compiler warnings.
>>
>
> I guess I got them because I'am checking sparse warnings as well.
>
> There is the original Linus' complain.
> http://permalink.gmane.org/gmane.linux.ide/59391
He's right, those casts are ugly and possibly wrong. I was thinking of
cleaning it up, but first I wanted to get it working at all with my
hardware.
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
> On Thu, 2015-12-17 at 15:13 +0000, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>> > On Tue, 2015-12-15 at 23:34 +0000, M?ns Rullg?rd wrote:
>> > > Mans Rullgard <[email protected]> writes:
>> > >
>> > > > Currently this driver only works with a DesignWare DMA engine
>> > > > which it registers manually using the second "reg" address
>> > > > range and interrupt number from the DT node.
>> > > >
>> > > > This patch makes the driver instead use the "dmas" property if
>> > > > present, otherwise optionally falling back on the old way so
>> > > > existing device trees can continue to work.
>> > > >
>> > > > With this change, there is no longer any reason to depend on
>> > > > the 460EX machine type so drop that from Kconfig.
>> > > >
>> > > > Signed-off-by: Mans Rullgard <[email protected]>
>> > > > ---
>> > > > ?drivers/ata/Kconfig??????????|??10 ++-
>> > > > ?drivers/ata/sata_dwc_460ex.c | 192
>> > > > +++++++++++++++++++++++++++--
>> > > > --------------
>> > > > ?2 files changed, 131 insertions(+), 71 deletions(-)
>> > >
>> > > The corresponding patch for the canyonlands devicetree looks
>> > > something
>> > > like this.??I don't have any such hardware or even a manual, so I
>> > > don't
>> > > know what values to use for the various required DT properties of
>> > > the
>> > > DMA controller node, nor can I test it.??The SATA driver works
>> > > with a
>> > > different DMA controller on a Sigma Designs chip.
>> > >
>> > > diff --git a/arch/powerpc/boot/dts/canyonlands.dts
>> > > b/arch/powerpc/boot/dts/canyonlands.dts
>> > > index 3dc75de..959f36e 100644
>> > > --- a/arch/powerpc/boot/dts/canyonlands.dts
>> > > +++ b/arch/powerpc/boot/dts/canyonlands.dts
>> > > @@ -190,12 +190,22 @@
>> > > ? ?/* DMA */ 0x2 &UIC0 0xc
>> > > 0x4>;
>> > > ? };
>> > > ?
>> > > + DMA0: dma@bffd0800 {
>> > > + compatible = "snps,dma-spear1340";
>> > > + reg = <4 0xbffd0800 0x400>;
>> > > + interrupt-parent = <&UIC3>;
>> > > + interrupts = <0x5 0x4>;
>> > > + #dma-cells = <3>;
>> > > + /* required properties here */
>> >
>> > You have to move the master assignments and other custom dw_dmac
>> > properties. Maybe at some point I will fix that in dw/platform.c.
>> >
>> > > + };
>>
>> The current sata_dwc driver calls dw_dma_probe() with null pdata
>> which causes the dw_dma driver to auto-detect most parameters.??It
>> looks like simply omitting those properties here results in the same
>> thing, although in this case dw_dma_parse_dt() leaves a
>> devm-allocated pdata struct adrift.??Deferring the allocation of that
>> and changing the DT binding doc to make these properties optional for
>> auto-detect-capable hardware should just work.
>
> Yeah, I would like to allow autoconfiguration in case of DT as well and
> translate it to use unified device property API.
>
>> Something like this:
>
> If it works for you, please, submit as a patch. Thanks.
I can't test it since I have no such hardware.
--
M?ns Rullg?rd
On Thu, 2015-12-17 at 16:04 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > On Thu, 2015-12-17 at 15:13 +0000, Måns Rullgård wrote:
> > > Andy Shevchenko <[email protected]> writes:
> > >
> > > > On Tue, 2015-12-15 at 23:34 +0000, Måns Rullgård wrote:
> > > > > Mans Rullgard <[email protected]> writes:
> > > > >
> > > > > > Currently this driver only works with a DesignWare DMA
> > > > > > engine
> > > > > > which it registers manually using the second "reg" address
> > > > > > range and interrupt number from the DT node.
> > > > > >
> > > > > > This patch makes the driver instead use the "dmas" property
> > > > > > if
> > > > > > present, otherwise optionally falling back on the old way
> > > > > > so
> > > > > > existing device trees can continue to work.
> > > > > >
> > > > > > With this change, there is no longer any reason to depend
> > > > > > on
> > > > > > the 460EX machine type so drop that from Kconfig.
> > > > > >
> > > > > > Signed-off-by: Mans Rullgard <[email protected]>
> > > > > > ---
> > > > > > drivers/ata/Kconfig | 10 ++-
> > > > > > drivers/ata/sata_dwc_460ex.c | 192
> > > > > > +++++++++++++++++++++++++++--
> > > > > > --------------
> > > > > > 2 files changed, 131 insertions(+), 71 deletions(-)
> > > > >
> > > > > The corresponding patch for the canyonlands devicetree looks
> > > > > something
> > > > > like this. I don't have any such hardware or even a manual,
> > > > > so I
> > > > > don't
> > > > > know what values to use for the various required DT
> > > > > properties of
> > > > > the
> > > > > DMA controller node, nor can I test it. The SATA driver
> > > > > works
> > > > > with a
> > > > > different DMA controller on a Sigma Designs chip.
> > > > >
> > > > > diff --git a/arch/powerpc/boot/dts/canyonlands.dts
> > > > > b/arch/powerpc/boot/dts/canyonlands.dts
> > > > > index 3dc75de..959f36e 100644
> > > > > --- a/arch/powerpc/boot/dts/canyonlands.dts
> > > > > +++ b/arch/powerpc/boot/dts/canyonlands.dts
> > > > > @@ -190,12 +190,22 @@
> > > > > /* DMA */ 0x2 &UIC0
> > > > > 0xc
> > > > > 0x4>;
> > > > > };
> > > > >
> > > > > + DMA0: dma@bffd0800 {
> > > > > + compatible = "snps,dma-spear1340";
> > > > > + reg = <4 0xbffd0800 0x400>;
> > > > > + interrupt-parent = <&UIC3>;
> > > > > + interrupts = <0x5 0x4>;
> > > > > + #dma-cells = <3>;
> > > > > + /* required properties here */
> > > >
> > > > You have to move the master assignments and other custom
> > > > dw_dmac
> > > > properties. Maybe at some point I will fix that in
> > > > dw/platform.c.
> > > >
> > > > > + };
> > >
> > > The current sata_dwc driver calls dw_dma_probe() with null pdata
> > > which causes the dw_dma driver to auto-detect most
> > > parameters. It
> > > looks like simply omitting those properties here results in the
> > > same
> > > thing, although in this case dw_dma_parse_dt() leaves a
> > > devm-allocated pdata struct adrift. Deferring the allocation of
> > > that
> > > and changing the DT binding doc to make these properties optional
> > > for
> > > auto-detect-capable hardware should just work.
> >
> > Yeah, I would like to allow autoconfiguration in case of DT as well
> > and
> > translate it to use unified device property API.
> >
> > > Something like this:
> >
> > If it works for you, please, submit as a patch. Thanks.
>
> I can't test it since I have no such hardware.
It's currently broken, last person who seems to have it is
(was?) Julian Margetson [1]
[1] https://patchwork.ozlabs.org/patch/439850/
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On 12/17/2015 12:53 PM, Andy Shevchenko wrote:
> On Thu, 2015-12-17 at 16:04 +0000, Måns Rullgård wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>> On Thu, 2015-12-17 at 15:13 +0000, Måns Rullgård wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>> On Tue, 2015-12-15 at 23:34 +0000, Måns Rullgård wrote:
>>>>>> Mans Rullgard <[email protected]> writes:
>>>>>>
>>>>>>> Currently this driver only works with a DesignWare DMA
>>>>>>> engine
>>>>>>> which it registers manually using the second "reg" address
>>>>>>> range and interrupt number from the DT node.
>>>>>>>
>>>>>>> This patch makes the driver instead use the "dmas" property
>>>>>>> if
>>>>>>> present, otherwise optionally falling back on the old way
>>>>>>> so
>>>>>>> existing device trees can continue to work.
>>>>>>>
>>>>>>> With this change, there is no longer any reason to depend
>>>>>>> on
>>>>>>> the 460EX machine type so drop that from Kconfig.
>>>>>>>
>>>>>>> Signed-off-by: Mans Rullgard <[email protected]>
>>>>>>> ---
>>>>>>> drivers/ata/Kconfig | 10 ++-
>>>>>>> drivers/ata/sata_dwc_460ex.c | 192
>>>>>>> +++++++++++++++++++++++++++--
>>>>>>> --------------
>>>>>>> 2 files changed, 131 insertions(+), 71 deletions(-)
>>>>>> The corresponding patch for the canyonlands devicetree looks
>>>>>> something
>>>>>> like this. I don't have any such hardware or even a manual,
>>>>>> so I
>>>>>> don't
>>>>>> know what values to use for the various required DT
>>>>>> properties of
>>>>>> the
>>>>>> DMA controller node, nor can I test it. The SATA driver
>>>>>> works
>>>>>> with a
>>>>>> different DMA controller on a Sigma Designs chip.
>>>>>>
>>>>>> diff --git a/arch/powerpc/boot/dts/canyonlands.dts
>>>>>> b/arch/powerpc/boot/dts/canyonlands.dts
>>>>>> index 3dc75de..959f36e 100644
>>>>>> --- a/arch/powerpc/boot/dts/canyonlands.dts
>>>>>> +++ b/arch/powerpc/boot/dts/canyonlands.dts
>>>>>> @@ -190,12 +190,22 @@
>>>>>> /* DMA */ 0x2 &UIC0
>>>>>> 0xc
>>>>>> 0x4>;
>>>>>> };
>>>>>>
>>>>>> + DMA0: dma@bffd0800 {
>>>>>> + compatible = "snps,dma-spear1340";
>>>>>> + reg = <4 0xbffd0800 0x400>;
>>>>>> + interrupt-parent = <&UIC3>;
>>>>>> + interrupts = <0x5 0x4>;
>>>>>> + #dma-cells = <3>;
>>>>>> + /* required properties here */
>>>>> You have to move the master assignments and other custom
>>>>> dw_dmac
>>>>> properties. Maybe at some point I will fix that in
>>>>> dw/platform.c.
>>>>>
>>>>>> + };
>>>> The current sata_dwc driver calls dw_dma_probe() with null pdata
>>>> which causes the dw_dma driver to auto-detect most
>>>> parameters. It
>>>> looks like simply omitting those properties here results in the
>>>> same
>>>> thing, although in this case dw_dma_parse_dt() leaves a
>>>> devm-allocated pdata struct adrift. Deferring the allocation of
>>>> that
>>>> and changing the DT binding doc to make these properties optional
>>>> for
>>>> auto-detect-capable hardware should just work.
>>> Yeah, I would like to allow autoconfiguration in case of DT as well
>>> and
>>> translate it to use unified device property API.
>>>
>>>> Something like this:
>>> If it works for you, please, submit as a patch. Thanks.
>> I can't test it since I have no such hardware.
> It's currently broken, last person who seems to have it is
> (was?) Julian Margetson [1]
>
> [1] https://patchwork.ozlabs.org/patch/439850/
>
I have been running my machine mostly configured for pciex1 thus with
the sata_dwc disabled.
The changes to sata_dwc-460ex do cause an oops.
I will try to give more detailed info over this weekend .
Julian Margetson <[email protected]> writes:
> I have been running my machine mostly configured for pciex1 thus with
> the sata_dwc disabled.
> The changes to sata_dwc-460ex do cause an oops.
> I will try to give more detailed info over this weekend .
The driver as is upstream would do that since it unconditionally
dereferences a null pointer in the probe function. My patch fixes that
as a side-effect.
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/17/2015 1:59 PM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> I have been running my machine mostly configured for pciex1 thus with
>>> the sata_dwc disabled.
>>> The changes to sata_dwc-460ex do cause an oops.
>>> I will try to give more detailed info over this weekend .
>> The driver as is upstream would do that since it unconditionally
>> dereferences a null pointer in the probe function. My patch fixes that
>> as a side-effect.
>>
>
> patching file drivers/ata/Kconfig
>
> Hunk #1 FAILED at 296.
[...]
> root@julian-VirtualBox:/usr/src/linux-3.18.25#
The patch is against 4.4-rc5.
--
M?ns Rullg?rd
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 4.4.0-rc5 Kernel Configuration
#
# CONFIG_PPC64 is not set
#
# Processor support
#
# CONFIG_PPC_BOOK3S_32 is not set
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
# CONFIG_40x is not set
CONFIG_44x=y
# CONFIG_E200 is not set
CONFIG_PPC_FPU=y
CONFIG_4xx=y
CONFIG_BOOKE=y
CONFIG_PTE_64BIT=y
CONFIG_PHYS_64BIT=y
CONFIG_PPC_MMU_NOHASH=y
# CONFIG_PPC_MM_SLICES is not set
CONFIG_NOT_COHERENT_CACHE=y
# CONFIG_PPC_DOORBELL is not set
CONFIG_VDSO32=y
CONFIG_CPU_BIG_ENDIAN=y
CONFIG_PPC32=y
CONFIG_32BIT=y
CONFIG_WORD_SIZE=32
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_MMU=y
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
CONFIG_NR_IRQS=512
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y
CONFIG_PPC=y
# CONFIG_GENERIC_CSUM is not set
CONFIG_EARLY_PRINTK=y
CONFIG_PANIC_TIMEOUT=180
CONFIG_GENERIC_NVRAM=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_UDBG_16550=y
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_EPAPR_BOOT is not set
# CONFIG_DEFAULT_UIMAGE is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_PPC_DCR_NATIVE=y
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_PPC_DCR=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_PPC_ADV_DEBUG_REGS=y
CONFIG_PPC_ADV_DEBUG_IACS=4
CONFIG_PPC_ADV_DEBUG_DACS=2
CONFIG_PPC_ADV_DEBUG_DVCS=2
CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y
CONFIG_PGTABLE_LEVELS=2
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_CROSS_MEMORY_ATTACH=y
# CONFIG_FHANDLE is not set
CONFIG_USELIB=y
# CONFIG_AUDIT is not set
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_IRQ_DOMAIN=y
CONFIG_GENERIC_MSI_IRQ=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_GENERIC_TIME_VSYSCALL_OLD=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y
#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
# CONFIG_TASKS_RCU is not set
# CONFIG_RCU_STALL_COMMON is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_EXPEDITE_BOOT is not set
# CONFIG_BUILD_BIN2C is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_CGROUPS is not set
# CONFIG_CHECKPOINT_RESTORE is not set
# CONFIG_NAMESPACES is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
CONFIG_SGETMASK_SYSCALL=y
CONFIG_SYSFS_SYSCALL=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
# CONFIG_BPF_SYSCALL is not set
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_ADVISE_SYSCALLS=y
# CONFIG_USERFAULTFD is not set
CONFIG_PCI_QUIRKS=y
CONFIG_MEMBARRIER=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y
#
# Kernel Performance Events And Counters
#
# CONFIG_PERF_EVENTS is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
# CONFIG_SYSTEM_DATA_VERIFICATION is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_JUMP_LABEL is not set
# CONFIG_UPROBES is not set
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP_FILTER=y
# CONFIG_CC_STACKPROTECTOR is not set
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_OLD_SIGSUSPEND=y
CONFIG_OLD_SIGACTION=y
#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
# CONFIG_MODULES is not set
CONFIG_BLOCK=y
CONFIG_LBDAF=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_BSGLIB is not set
# CONFIG_BLK_DEV_INTEGRITY is not set
# CONFIG_BLK_CMDLINE_PARSER is not set
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y
#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_FREEZER=y
CONFIG_PPC4xx_PCI_EXPRESS=y
# CONFIG_PPC4xx_HSTA_MSI is not set
CONFIG_PPC4xx_MSI=y
CONFIG_PPC_MSI_BITMAP=y
# CONFIG_PPC_XICS is not set
# CONFIG_PPC_ICP_NATIVE is not set
# CONFIG_PPC_ICP_HV is not set
# CONFIG_PPC_ICS_RTAS is not set
# CONFIG_GE_FPGA is not set
#
# Platform support
#
# CONFIG_PPC_CELL is not set
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PQ2ADS is not set
# CONFIG_PPC_47x is not set
# CONFIG_BAMBOO is not set
# CONFIG_BLUESTONE is not set
# CONFIG_EBONY is not set
# CONFIG_SAM440EP is not set
# CONFIG_SEQUOIA is not set
# CONFIG_TAISHAN is not set
# CONFIG_KATMAI is not set
# CONFIG_RAINIER is not set
# CONFIG_WARP is not set
# CONFIG_ARCHES is not set
CONFIG_CANYONLANDS=y
# CONFIG_GLACIER is not set
# CONFIG_REDWOOD is not set
# CONFIG_EIGER is not set
# CONFIG_YOSEMITE is not set
# CONFIG_ISS4xx is not set
# CONFIG_ICON is not set
# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
# CONFIG_PPC44x_SIMPLE is not set
# CONFIG_PPC4xx_GPIO is not set
# CONFIG_PPC4xx_OCM is not set
CONFIG_460EX=y
# CONFIG_KVM_GUEST is not set
# CONFIG_EPAPR_PARAVIRT is not set
# CONFIG_IPIC is not set
# CONFIG_MPIC is not set
# CONFIG_PPC_EPAPR_HV_PIC is not set
# CONFIG_MPIC_WEIRD is not set
# CONFIG_PPC_I8259 is not set
# CONFIG_PPC_RTAS is not set
# CONFIG_MMIO_NVRAM is not set
# CONFIG_MPIC_U3_HT_IRQS is not set
# CONFIG_PPC_MPC106 is not set
# CONFIG_PPC_970_NAP is not set
# CONFIG_PPC_P7_NAP is not set
#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
#
# CPUIdle driver
#
#
# CPU Idle
#
# CONFIG_CPU_IDLE is not set
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
# CONFIG_FSL_ULI1575 is not set
# CONFIG_SIMPLE_GPIO is not set
#
# Kernel options
#
# CONFIG_HIGHMEM is not set
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
CONFIG_SCHED_HRTICK=y
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_BINFMT_ELF=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y
# CONFIG_MATH_EMULATION is not set
# CONFIG_IOMMU_HELPER is not set
# CONFIG_SWIOTLB is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_HAS_WALK_MEMORY=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
# CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_HAVE_GENERIC_RCU_GUP=y
CONFIG_NO_BOOTMEM=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_COMPACTION=y
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_CLEANCACHE is not set
# CONFIG_FRONTSWAP is not set
# CONFIG_CMA is not set
# CONFIG_ZPOOL is not set
# CONFIG_ZBUD is not set
# CONFIG_ZSMALLOC is not set
# CONFIG_IDLE_PAGE_TRACKING is not set
CONFIG_STDBINUTILS=y
CONFIG_PPC_4K_PAGES=y
# CONFIG_PPC_16K_PAGES is not set
# CONFIG_PPC_64K_PAGES is not set
CONFIG_FORCE_MAX_ZONEORDER=11
# CONFIG_PPC_COPRO_BASE is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE=""
# CONFIG_CMDLINE_FORCE is not set
CONFIG_EXTRA_TARGETS=""
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
# CONFIG_HIBERNATION is not set
CONFIG_PM_SLEEP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
#
# Bus options
#
CONFIG_ZONE_DMA=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_PPC_INDIRECT_PCI=y
CONFIG_PPC4xx_CPM=y
CONFIG_4xx_SOC=y
CONFIG_PPC_PCI_CHOICE=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_SYSCALL=y
# CONFIG_PCIEPORTBUS is not set
CONFIG_PCI_BUS_ADDR_T_64BIT=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set
# CONFIG_PCI_STUB is not set
# CONFIG_PCI_IOV is not set
# CONFIG_PCI_PRI is not set
# CONFIG_PCI_PASID is not set
#
# PCI host controller drivers
#
# CONFIG_PCCARD is not set
# CONFIG_HOTPLUG_PCI is not set
# CONFIG_HAS_RAPIDIO is not set
# CONFIG_RAPIDIO is not set
# CONFIG_NONSTATIC_KERNEL is not set
#
# Advanced setup
#
# CONFIG_ADVANCED_OPTIONS is not set
#
# Default settings for advanced configuration options are used
#
CONFIG_LOWMEM_SIZE=0x30000000
CONFIG_PAGE_OFFSET=0xc0000000
CONFIG_KERNEL_START=0xc0000000
CONFIG_PHYSICAL_START=0x00000000
CONFIG_TASK_SIZE=0xc0000000
CONFIG_CONSISTENT_SIZE=0x00200000
# CONFIG_ARCH_RANDOM is not set
CONFIG_NET=y
#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
# CONFIG_XFRM_USER is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_NET_UDP_TUNNEL is not set
# CONFIG_NET_FOU is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NET_PTP_CLASSIFY is not set
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_MMAP is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_MPLS is not set
# CONFIG_HSR is not set
# CONFIG_NET_SWITCHDEV is not set
# CONFIG_NET_L3_MASTER_DEV is not set
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
# CONFIG_LIB80211 is not set
#
# CFG80211 needs to be enabled for MAC80211
#
CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
# CONFIG_LWTUNNEL is not set
CONFIG_HAVE_BPF_JIT=y
#
# Device Drivers
#
#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
CONFIG_ALLOW_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
# CONFIG_DMA_SHARED_BUFFER is not set
#
# Bus devices
#
CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y
CONFIG_MTD=y
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_OF_PARTS=y
# CONFIG_MTD_AR7_PARTS is not set
#
# User Modules And Translation Layers
#
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set
# CONFIG_MTD_PARTITIONED_MASTER is not set
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
CONFIG_MTD_PHYSMAP_OF=y
# CONFIG_MTD_INTEL_VR_NOR is not set
# CONFIG_MTD_PLATRAM is not set
#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOCG3 is not set
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_ECC_SMC=y
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_ECC_BCH is not set
# CONFIG_MTD_SM_COMMON is not set
# CONFIG_MTD_NAND_DENALI_PCI is not set
# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_RICOH is not set
CONFIG_MTD_NAND_NDFC=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_DOCG4 is not set
# CONFIG_MTD_NAND_CAFE is not set
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_NAND_FSL_ELBC is not set
# CONFIG_MTD_NAND_HISI504 is not set
# CONFIG_MTD_ONENAND is not set
#
# LPDDR & LPDDR2 PCM memory drivers
#
# CONFIG_MTD_LPDDR is not set
# CONFIG_MTD_SPI_NOR is not set
# CONFIG_MTD_UBI is not set
CONFIG_DTC=y
CONFIG_OF=y
# CONFIG_OF_UNITTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_ADDRESS_PCI=y
CONFIG_OF_IRQ=y
CONFIG_OF_NET=y
CONFIG_OF_PCI=y
CONFIG_OF_PCI_IRQ=y
CONFIG_OF_MTD=y
CONFIG_OF_RESERVED_MEM=y
# CONFIG_OF_OVERLAY is not set
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_NULL_BLK is not set
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=35000
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_XILINX_SYSACE is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_RSXX is not set
# CONFIG_BLK_DEV_NVME is not set
#
# Misc devices
#
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_PHANTOM is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_BMP085_I2C is not set
# CONFIG_USB_SWITCH_FSA9480 is not set
# CONFIG_SRAM is not set
# CONFIG_C2PORT is not set
#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_CB710_CORE is not set
#
# Texas Instruments shared transport line discipline
#
#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set
#
# Intel MIC Bus Driver
#
#
# SCIF Bus Driver
#
#
# Intel MIC Host Driver
#
#
# Intel MIC Card Driver
#
#
# SCIF Driver
#
#
# Intel MIC Coprocessor State Management (COSM) Drivers
#
# CONFIG_ECHO is not set
# CONFIG_CXL_BASE is not set
# CONFIG_CXL_KERNEL_API is not set
# CONFIG_CXL_EEH is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_NETLINK is not set
# CONFIG_SCSI_MQ_DEFAULT is not set
CONFIG_SCSI_PROC_FS=y
#
# SCSI support type (disk, tape, CD-ROM)
#
# CONFIG_BLK_DEV_SD is not set
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
# CONFIG_CHR_DEV_SCH is not set
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
# CONFIG_SCSI_SCAN_ASYNC is not set
#
# SCSI Transports
#
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_HPSA is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_SCSI_ESAS2R is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_UFSHCD is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_SNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_WD719X is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
# CONFIG_SATA_PMP is not set
#
# Controllers with non-SFF native interface
#
# CONFIG_SATA_AHCI is not set
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_AHCI_CEVA is not set
# CONFIG_AHCI_QORIQ is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y
#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y
#
# SATA SFF controllers with BMDMA
#
# CONFIG_ATA_PIIX is not set
CONFIG_SATA_DWC=y
CONFIG_SATA_DWC_OLD_DMA=y
# CONFIG_SATA_DWC_DEBUG is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_SCH is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set
#
# Generic fallback / legacy drivers
#
# CONFIG_ATA_GENERIC is not set
# CONFIG_PATA_LEGACY is not set
# CONFIG_MD is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set
#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_FC is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_TUN is not set
# CONFIG_TUN_VNET_CROSS_LE is not set
# CONFIG_VETH is not set
# CONFIG_NLMON is not set
# CONFIG_ARCNET is not set
#
# CAIF transport drivers
#
#
# Distributed Switch Architecture drivers
#
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_3COM=y
# CONFIG_VORTEX is not set
# CONFIG_TYPHOON is not set
CONFIG_NET_VENDOR_ADAPTEC=y
# CONFIG_ADAPTEC_STARFIRE is not set
CONFIG_NET_VENDOR_AGERE=y
# CONFIG_ET131X is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
# CONFIG_ALTERA_TSE is not set
CONFIG_NET_VENDOR_AMD=y
# CONFIG_AMD8111_ETH is not set
# CONFIG_PCNET32 is not set
CONFIG_NET_VENDOR_ARC=y
# CONFIG_ARC_EMAC is not set
CONFIG_NET_VENDOR_ATHEROS=y
# CONFIG_ATL2 is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
# CONFIG_ATL1C is not set
# CONFIG_ALX is not set
# CONFIG_NET_VENDOR_AURORA is not set
CONFIG_NET_CADENCE=y
# CONFIG_MACB is not set
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_BCMGENET is not set
# CONFIG_BNX2 is not set
# CONFIG_CNIC is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2X is not set
# CONFIG_SYSTEMPORT is not set
# CONFIG_BNXT is not set
CONFIG_NET_VENDOR_BROCADE=y
# CONFIG_BNA is not set
CONFIG_NET_VENDOR_CAVIUM=y
CONFIG_NET_VENDOR_CHELSIO=y
# CONFIG_CHELSIO_T1 is not set
# CONFIG_CHELSIO_T3 is not set
# CONFIG_CHELSIO_T4 is not set
# CONFIG_CHELSIO_T4VF is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_DEC=y
# CONFIG_NET_TULIP is not set
CONFIG_NET_VENDOR_DLINK=y
# CONFIG_DL2K is not set
# CONFIG_SUNDANCE is not set
CONFIG_NET_VENDOR_EMULEX=y
# CONFIG_BE2NET is not set
CONFIG_NET_VENDOR_EZCHIP=y
# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set
CONFIG_NET_VENDOR_EXAR=y
# CONFIG_S2IO is not set
# CONFIG_VXGE is not set
CONFIG_NET_VENDOR_HP=y
# CONFIG_HP100 is not set
CONFIG_NET_VENDOR_IBM=y
CONFIG_IBM_EMAC=y
CONFIG_IBM_EMAC_RXB=256
CONFIG_IBM_EMAC_TXB=256
CONFIG_IBM_EMAC_POLL_WEIGHT=32
CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
CONFIG_IBM_EMAC_RX_SKB_HEADROOM=0
# CONFIG_IBM_EMAC_DEBUG is not set
CONFIG_IBM_EMAC_ZMII=y
CONFIG_IBM_EMAC_RGMII=y
CONFIG_IBM_EMAC_TAH=y
CONFIG_IBM_EMAC_EMAC4=y
# CONFIG_IBM_EMAC_NO_FLOW_CTRL is not set
# CONFIG_IBM_EMAC_MAL_CLR_ICINTSTAT is not set
# CONFIG_IBM_EMAC_MAL_COMMON_ERR is not set
CONFIG_NET_VENDOR_INTEL=y
# CONFIG_E100 is not set
# CONFIG_E1000 is not set
# CONFIG_E1000E is not set
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_FM10K is not set
CONFIG_NET_VENDOR_I825XX=y
# CONFIG_JME is not set
CONFIG_NET_VENDOR_MARVELL=y
# CONFIG_MV643XX_ETH is not set
# CONFIG_MVMDIO is not set
# CONFIG_SKGE is not set
# CONFIG_SKY2 is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
# CONFIG_MLX4_CORE is not set
# CONFIG_MLX5_CORE is not set
# CONFIG_MLXSW_CORE is not set
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8842 is not set
# CONFIG_KS8851_MLL is not set
# CONFIG_KSZ884X_PCI is not set
CONFIG_NET_VENDOR_MYRI=y
# CONFIG_MYRI10GE is not set
# CONFIG_FEALNX is not set
CONFIG_NET_VENDOR_NATSEMI=y
# CONFIG_NATSEMI is not set
# CONFIG_NS83820 is not set
CONFIG_NET_VENDOR_8390=y
# CONFIG_NE2K_PCI is not set
CONFIG_NET_VENDOR_NVIDIA=y
# CONFIG_FORCEDETH is not set
CONFIG_NET_VENDOR_OKI=y
# CONFIG_ETHOC is not set
CONFIG_NET_PACKET_ENGINE=y
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
CONFIG_NET_VENDOR_QLOGIC=y
# CONFIG_QLA3XXX is not set
# CONFIG_QLCNIC is not set
# CONFIG_QLGE is not set
# CONFIG_NETXEN_NIC is not set
# CONFIG_QED is not set
CONFIG_NET_VENDOR_QUALCOMM=y
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
# CONFIG_R8169 is not set
CONFIG_NET_VENDOR_RENESAS=y
CONFIG_NET_VENDOR_RDC=y
# CONFIG_R6040 is not set
CONFIG_NET_VENDOR_ROCKER=y
CONFIG_NET_VENDOR_SAMSUNG=y
# CONFIG_SXGBE_ETH is not set
CONFIG_NET_VENDOR_SEEQ=y
CONFIG_NET_VENDOR_SILAN=y
# CONFIG_SC92031 is not set
CONFIG_NET_VENDOR_SIS=y
# CONFIG_SIS900 is not set
# CONFIG_SIS190 is not set
# CONFIG_SFC is not set
CONFIG_NET_VENDOR_SMSC=y
# CONFIG_EPIC100 is not set
# CONFIG_SMSC911X is not set
# CONFIG_SMSC9420 is not set
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_SUN=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NIU is not set
CONFIG_NET_VENDOR_SYNOPSYS=y
# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set
CONFIG_NET_VENDOR_TEHUTI=y
# CONFIG_TEHUTI is not set
CONFIG_NET_VENDOR_TI=y
# CONFIG_TI_CPSW_ALE is not set
# CONFIG_TLAN is not set
CONFIG_NET_VENDOR_VIA=y
# CONFIG_VIA_RHINE is not set
# CONFIG_VIA_VELOCITY is not set
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_NET_VENDOR_XILINX=y
# CONFIG_XILINX_EMACLITE is not set
# CONFIG_XILINX_LL_TEMAC is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PHYLIB is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
CONFIG_USB_NET_DRIVERS=y
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_RTL8152 is not set
# CONFIG_USB_LAN78XX is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_IPHETH is not set
CONFIG_WLAN=y
# CONFIG_PRISM54 is not set
# CONFIG_HOSTAP is not set
# CONFIG_WL_MEDIATEK is not set
# CONFIG_WL_TI is not set
#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
# CONFIG_VMXNET3 is not set
# CONFIG_ISDN is not set
# CONFIG_NVM is not set
#
# Input device support
#
# CONFIG_INPUT is not set
#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
# CONFIG_GAMEPORT is not set
#
# Character devices
#
CONFIG_TTY=y
# CONFIG_VT is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_NOZOMI is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_PPC_EPAPR_HV_BYTECHAN is not set
CONFIG_DEVMEM=y
CONFIG_DEVKMEM=y
#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
# CONFIG_SERIAL_8250_PCI is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_RSA is not set
CONFIG_SERIAL_8250_FSL=y
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_RT288X is not set
# CONFIG_SERIAL_8250_INGENIC is not set
# CONFIG_SERIAL_8250_MID is not set
#
# Non-8250 serial port support
#
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
# CONFIG_TTY_PRINTK is not set
# CONFIG_HVC_UDBG is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
# CONFIG_XILLYBUS is not set
#
# I2C support
#
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_MUX is not set
CONFIG_I2C_HELPER_AUTO=y
#
# I2C Hardware Bus support
#
#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
CONFIG_I2C_IBM_IIC=y
# CONFIG_I2C_MPC is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set
#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_DIOLAN_U2C is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_ROBOTFUZZ_OSIF is not set
# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_TINY_USB is not set
#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_SLAVE is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_SPI is not set
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
#
# PPS support
#
# CONFIG_PPS is not set
#
# PPS generators support
#
#
# PTP clock support
#
# CONFIG_PTP_1588_CLOCK is not set
#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
# CONFIG_GPIOLIB is not set
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_POWER_AVS is not set
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_HWMON_DEBUG_CHIP is not set
#
# Native drivers
#
CONFIG_SENSORS_AD7414=y
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_HIH6130 is not set
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_POWR1220 is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LTC2945 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4222 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4260 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6642 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_HTU21 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_NCT7802 is not set
# CONFIG_SENSORS_NCT7904 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SHTC1 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SCH56XX_COMMON is not set
# CONFIG_SENSORS_SMM665 is not set
# CONFIG_SENSORS_ADC128D818 is not set
# CONFIG_SENSORS_ADS1015 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_TC74 is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP103 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y
#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y
#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set
#
# Multifunction device drivers
#
# CONFIG_MFD_CORE is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_ATMEL_FLEXCOM is not set
# CONFIG_MFD_ATMEL_HLCDC is not set
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_AXP20X is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
# CONFIG_MFD_DLN2 is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_MFD_HI6421_PMIC is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_LPC_ICH is not set
# CONFIG_LPC_SCH is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
# CONFIG_MFD_88PM860X is not set
# CONFIG_MFD_MAX14577 is not set
# CONFIG_MFD_MAX77686 is not set
# CONFIG_MFD_MAX77693 is not set
# CONFIG_MFD_MAX77843 is not set
# CONFIG_MFD_MAX8907 is not set
# CONFIG_MFD_MAX8925 is not set
# CONFIG_MFD_MAX8997 is not set
# CONFIG_MFD_MAX8998 is not set
# CONFIG_MFD_MT6397 is not set
# CONFIG_MFD_MENF21BMC is not set
# CONFIG_MFD_VIPERBOARD is not set
# CONFIG_MFD_RETU is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RTSX_PCI is not set
# CONFIG_MFD_RT5033 is not set
# CONFIG_MFD_RTSX_USB is not set
# CONFIG_MFD_RC5T583 is not set
# CONFIG_MFD_RK808 is not set
# CONFIG_MFD_RN5T618 is not set
# CONFIG_MFD_SEC_CORE is not set
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_MFD_SKY81452 is not set
# CONFIG_MFD_SMSC is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_MFD_STMPE is not set
# CONFIG_MFD_SYSCON is not set
# CONFIG_MFD_TI_AM335X_TSCADC is not set
# CONFIG_MFD_LP3943 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_PALMAS is not set
# CONFIG_TPS6105X is not set
# CONFIG_TPS6507X is not set
# CONFIG_MFD_TPS65090 is not set
# CONFIG_MFD_TPS65217 is not set
# CONFIG_MFD_TPS65218 is not set
# CONFIG_MFD_TPS6586X is not set
# CONFIG_MFD_TPS80031 is not set
# CONFIG_TWL4030_CORE is not set
# CONFIG_TWL6040_CORE is not set
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TC3589X is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM831X_I2C is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_WM8994 is not set
# CONFIG_REGULATOR is not set
# CONFIG_MEDIA_SUPPORT is not set
#
# Graphics support
#
# CONFIG_AGP is not set
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_DRM is not set
#
# Frame buffer Devices
#
# CONFIG_FB is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
# CONFIG_VGASTATE is not set
# CONFIG_SOUND is not set
CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_OTG is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
# CONFIG_USB_ULPI_BUS is not set
CONFIG_USB_MON=y
# CONFIG_USB_WUSB_CBAF is not set
#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
# CONFIG_USB_XHCI_HCD is not set
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
# CONFIG_XPS_USB_HCD_XILINX is not set
CONFIG_USB_EHCI_HCD_PPC_OF=y
# CONFIG_USB_EHCI_HCD_PLATFORM is not set
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_FOTG210_HCD is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
CONFIG_USB_OHCI_HCD_PPC_OF=y
CONFIG_USB_OHCI_HCD_PCI=y
# CONFIG_USB_OHCI_HCD_PLATFORM is not set
# CONFIG_USB_UHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HCD_TEST_MODE is not set
#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set
#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#
#
# also be needed; see USB_STORAGE Help for more info
#
# CONFIG_USB_STORAGE is not set
#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USBIP_CORE is not set
# CONFIG_USB_MUSB_HDRC is not set
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_CHIPIDEA is not set
# CONFIG_USB_ISP1760 is not set
#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set
#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_EHSET_TEST_FIXTURE is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_USB_HSIC_USB3503 is not set
# CONFIG_USB_LINK_LAYER_TEST is not set
#
# USB Physical Layer drivers
#
# CONFIG_USB_PHY is not set
# CONFIG_NOP_USB_XCEIV is not set
# CONFIG_USB_ISP1301 is not set
# CONFIG_USB_GADGET is not set
# CONFIG_UWB is not set
# CONFIG_MMC is not set
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
# CONFIG_EDAC is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set
#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_ABB5ZES3 is not set
# CONFIG_RTC_DRV_ABX80X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12057 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF85063 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
CONFIG_RTC_DRV_M41T80=y
# CONFIG_RTC_DRV_M41T80_WDT is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# CONFIG_RTC_DRV_RV8803 is not set
#
# SPI RTC drivers
#
#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
# CONFIG_RTC_DRV_ZYNQMP is not set
#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_GENERIC is not set
# CONFIG_RTC_DRV_SNVS is not set
#
# HID Sensor RTC drivers
#
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set
#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_OF=y
# CONFIG_FSL_EDMA is not set
# CONFIG_INTEL_IDMA64 is not set
CONFIG_DW_DMAC_CORE=y
CONFIG_DW_DMAC=y
# CONFIG_DW_DMAC_PCI is not set
#
# DMA Clients
#
# CONFIG_ASYNC_TX_DMA is not set
# CONFIG_DMATEST is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
# CONFIG_VIRT_DRIVERS is not set
#
# Virtio drivers
#
# CONFIG_VIRTIO_PCI is not set
# CONFIG_VIRTIO_MMIO is not set
#
# Microsoft Hyper-V guest support
#
# CONFIG_STAGING is not set
#
# Hardware Spinlock drivers
#
#
# Clock Source drivers
#
# CONFIG_ATMEL_PIT is not set
# CONFIG_SH_TIMER_CMT is not set
# CONFIG_SH_TIMER_MTU2 is not set
# CONFIG_SH_TIMER_TMU is not set
# CONFIG_EM_TIMER_STI is not set
# CONFIG_MAILBOX is not set
CONFIG_IOMMU_SUPPORT=y
#
# Generic IOMMU Pagetable Support
#
#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set
#
# Rpmsg drivers
#
#
# SOC (System On Chip) specific Drivers
#
# CONFIG_SUNXI_SRAM is not set
# CONFIG_SOC_TI is not set
# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
# CONFIG_NTB is not set
# CONFIG_VME_BUS is not set
# CONFIG_PWM is not set
CONFIG_IRQCHIP=y
# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set
# CONFIG_FMC is not set
#
# PHY Subsystem
#
# CONFIG_GENERIC_PHY is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
# CONFIG_BCM_KONA_USB2_PHY is not set
# CONFIG_POWERCAP is not set
# CONFIG_MCB is not set
#
# Performance monitor support
#
# CONFIG_RAS is not set
# CONFIG_THUNDERBOLT is not set
#
# Android
#
# CONFIG_ANDROID is not set
# CONFIG_LIBNVDIMM is not set
# CONFIG_NVMEM is not set
# CONFIG_STM is not set
# CONFIG_STM_DUMMY is not set
# CONFIG_STM_SOURCE_CONSOLE is not set
# CONFIG_INTEL_TH is not set
#
# FPGA Configuration Support
#
# CONFIG_FPGA is not set
#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT3_FS is not set
# CONFIG_EXT4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_FS_DAX is not set
# CONFIG_FS_POSIX_ACL is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
# CONFIG_QUOTA is not set
# CONFIG_QUOTACTL is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set
# CONFIG_OVERLAY_FS is not set
#
# Caches
#
# CONFIG_FSCACHE is not set
#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set
#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
# CONFIG_PROC_CHILDREN is not set
CONFIG_KERNFS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_TMPFS_XATTR is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_CONFIGFS_FS is not set
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS2_FS is not set
# CONFIG_LOGFS is not set
CONFIG_CRAMFS=y
# CONFIG_SQUASHFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX6FS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_PSTORE is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_SWAP is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
# CONFIG_NLS_MAC_GREEK is not set
# CONFIG_NLS_MAC_ICELAND is not set
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set
# CONFIG_BINARY_PRINTF is not set
#
# Library routines
#
CONFIG_BITREVERSE=y
# CONFIG_HAVE_ARCH_BITREVERSE is not set
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IO=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
# CONFIG_RANDOM32_SELFTEST is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_LZ4_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_DECOMPRESS_LZ4=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HAS_DMA=y
CONFIG_DQL=y
CONFIG_GLOB=y
# CONFIG_GLOB_SELFTEST is not set
CONFIG_NLATTR=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set
CONFIG_LIBFDT=y
# CONFIG_SG_SPLIT is not set
CONFIG_ARCH_HAS_SG_CHAIN=y
#
# Kernel hacking
#
#
# printk and dmesg options
#
# CONFIG_PRINTK_TIME is not set
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
# CONFIG_DYNAMIC_DEBUG is not set
#
# Compile-time checks and compiler options
#
# CONFIG_DEBUG_INFO is not set
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=1024
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_PAGE_OWNER is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_SECTION_MISMATCH_WARN_ONLY=y
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
CONFIG_DEBUG_KERNEL=y
#
# Memory Debugging
#
# CONFIG_PAGE_EXTENSION is not set
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
# CONFIG_SLUB_STATS is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_SHIRQ is not set
#
# Debug Lockups and Hangs
#
# CONFIG_LOCKUP_DETECTOR is not set
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHED_INFO is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_SCHED_STACK_END_CHECK is not set
# CONFIG_DEBUG_TIMEKEEPING is not set
# CONFIG_TIMER_STATS is not set
#
# Lock Debugging (spinlocks, mutexes, etc...)
#
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_LOCK_TORTURE_TEST is not set
# CONFIG_STACKTRACE is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_PI_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set
#
# RCU Debugging
#
# CONFIG_PROVE_RCU is not set
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_TORTURE_TEST is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_RCU_EQS_DEBUG is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
# CONFIG_FUNCTION_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
# CONFIG_ENABLE_DEFAULT_TRACERS is not set
# CONFIG_FTRACE_SYSCALLS is not set
# CONFIG_TRACER_SNAPSHOT is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_PROBE_EVENTS is not set
# CONFIG_TRACEPOINT_BENCHMARK is not set
#
# Runtime Testing
#
# CONFIG_LKDTM is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_HEXDUMP is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_PRINTF is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_TEST_FIRMWARE is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_MEMTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
# CONFIG_PPC_DISABLE_WERROR is not set
CONFIG_PPC_WERROR=y
# CONFIG_STRICT_MM_TYPECHECKS is not set
CONFIG_PRINT_STACK_DEPTH=64
# CONFIG_PPC_EMULATED_STATS is not set
# CONFIG_CODE_PATCHING_SELFTEST is not set
# CONFIG_FTR_FIXUP_SELFTEST is not set
# CONFIG_MSI_BITMAP_SELFTEST is not set
# CONFIG_XMON is not set
# CONFIG_BDI_SWITCH is not set
# CONFIG_PPC_EARLY_DEBUG is not set
CONFIG_STRICT_DEVMEM=y
#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y
#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_AKCIPHER2=y
# CONFIG_CRYPTO_RSA is not set
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
# CONFIG_CRYPTO_GF128MUL is not set
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_NULL2=y
CONFIG_CRYPTO_WORKQUEUE=y
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_MCRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
# CONFIG_CRYPTO_SEQIV is not set
CONFIG_CRYPTO_ECHAINIV=y
#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
# CONFIG_CRYPTO_ECB is not set
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set
# CONFIG_CRYPTO_KEYWRAP is not set
#
# Hash modes
#
# CONFIG_CRYPTO_CMAC is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set
#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRCT10DIF is not set
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_POLY1305 is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MD5_PPC is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA1_PPC is not set
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set
#
# Ciphers
#
CONFIG_CRYPTO_AES=y
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_CHACHA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set
#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_ZLIB is not set
# CONFIG_CRYPTO_LZO is not set
# CONFIG_CRYPTO_842 is not set
# CONFIG_CRYPTO_LZ4 is not set
# CONFIG_CRYPTO_LZ4HC is not set
#
# Random Number Generation
#
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_DRBG_HMAC=y
# CONFIG_CRYPTO_DRBG_HASH is not set
# CONFIG_CRYPTO_DRBG_CTR is not set
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_JITTERENTROPY=y
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
# CONFIG_CRYPTO_USER_API_RNG is not set
# CONFIG_CRYPTO_USER_API_AEAD is not set
CONFIG_CRYPTO_HW=y
# CONFIG_CRYPTO_DEV_PPC4XX is not set
#
# Certificates for signature checking
#
# CONFIG_VIRTUALIZATION is not set
Julian Margetson <[email protected]> writes:
> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>
>>>>> On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>
>>>>>>> I have been running my machine mostly configured for pciex1 thus with
>>>>>>> the sata_dwc disabled.
>>>>>>> The changes to sata_dwc-460ex do cause an oops.
>>>>>>> I will try to give more detailed info over this weekend .
>>>>>> The driver as is upstream would do that since it unconditionally
>>>>>> dereferences a null pointer in the probe function. My patch fixes that
>>>>>> as a side-effect.
>>>>>>
>>>>> patching file drivers/ata/Kconfig
>>>>>
>>>>> Hunk #1 FAILED at 296.
>>>> [...]
>>>>
>>>>> root@julian-VirtualBox:/usr/src/linux-3.18.25#
>>>> The patch is against 4.4-rc5.
>>>>
>>> CC drivers/ata/sata_dwc_460ex.o
>>>
>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>
>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>> ^
>> It builds, albeit with an unrelated warning, using the attached config.
>> Maybe there's a missing config dependency somewhere.
>>
> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
> with your .config.
> 4.4.0-rc5 builds ok with no patches applied .
> Once your patch is applied it fails to build .
>
> CC drivers/ata/sata_dwc_460ex.o
> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
> static struct dw_dma_slave sata_dwc_dma_dws = {
> ^
Bizarre. This is what it looks like here:
mru@unicorn:/tmp/linux-sata$ git status
On branch sata-dwc
nothing to commit, working directory clean
mru@unicorn:/tmp/linux-sata$ git describe
v4.4-rc5
mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
mru@unicorn:/tmp/linux-sata$ sha1sum .config
4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- drivers/ata/sata_dwc_460ex.o
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
UPD include/config/kernel.release
WRAP arch/powerpc/include/generated/asm/clkdev.h
WRAP arch/powerpc/include/generated/asm/div64.h
WRAP arch/powerpc/include/generated/asm/irq_regs.h
WRAP arch/powerpc/include/generated/asm/irq_work.h
WRAP arch/powerpc/include/generated/asm/local64.h
WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
WRAP arch/powerpc/include/generated/asm/preempt.h
WRAP arch/powerpc/include/generated/asm/rwsem.h
WRAP arch/powerpc/include/generated/asm/vtime.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
CHK include/generated/bounds.h
UPD include/generated/bounds.h
CHK include/generated/timeconst.h
UPD include/generated/timeconst.h
CC arch/powerpc/kernel/asm-offsets.s
CHK include/generated/asm-offsets.h
UPD include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
HOSTCC scripts/dtc/dtc-lexer.lex.o
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/modpost.o
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
HOSTCC scripts/kallsyms
CC drivers/ata/sata_dwc_460ex.o
drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
^
mru@unicorn:/tmp/linux-sata$
Patch file and .config attached.
Looking into that warning, I doubt it works as is, but that's not caused
by my patch. I can try to come up with a fix, but again, I can't test it.
--
Måns Rullgård
On 12/17/2015 8:06 PM, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>
>>>>>> On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>
>>>>>>>> I have been running my machine mostly configured for pciex1 thus with
>>>>>>>> the sata_dwc disabled.
>>>>>>>> The changes to sata_dwc-460ex do cause an oops.
>>>>>>>> I will try to give more detailed info over this weekend .
>>>>>>> The driver as is upstream would do that since it unconditionally
>>>>>>> dereferences a null pointer in the probe function. My patch fixes that
>>>>>>> as a side-effect.
>>>>>>>
>>>>>> patching file drivers/ata/Kconfig
>>>>>>
>>>>>> Hunk #1 FAILED at 296.
>>>>> [...]
>>>>>
>>>>>> root@julian-VirtualBox:/usr/src/linux-3.18.25#
>>>>> The patch is against 4.4-rc5.
>>>>>
>>>> CC drivers/ata/sata_dwc_460ex.o
>>>>
>>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>>
>>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>>> ^
>>> It builds, albeit with an unrelated warning, using the attached config.
>>> Maybe there's a missing config dependency somewhere.
>>>
>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>> with your .config.
>> 4.4.0-rc5 builds ok with no patches applied .
>> Once your patch is applied it fails to build .
>>
>> CC drivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>> static struct dw_dma_slave sata_dwc_dma_dws = {
>> ^
> Bizarre. This is what it looks like here:
>
> mru@unicorn:/tmp/linux-sata$ git status
> On branch sata-dwc
> nothing to commit, working directory clean
> mru@unicorn:/tmp/linux-sata$ git describe
> v4.4-rc5
> mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
> mru@unicorn:/tmp/linux-sata$ sha1sum .config
> 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> SHIPPED scripts/kconfig/zconf.tab.c
> SHIPPED scripts/kconfig/zconf.lex.c
> SHIPPED scripts/kconfig/zconf.hash.c
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> scripts/kconfig/conf --oldconfig Kconfig
> #
> # configuration written to .config
> #
> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- drivers/ata/sata_dwc_460ex.o
> scripts/kconfig/conf --silentoldconfig Kconfig
> CHK include/config/kernel.release
> UPD include/config/kernel.release
> WRAP arch/powerpc/include/generated/asm/clkdev.h
> WRAP arch/powerpc/include/generated/asm/div64.h
> WRAP arch/powerpc/include/generated/asm/irq_regs.h
> WRAP arch/powerpc/include/generated/asm/irq_work.h
> WRAP arch/powerpc/include/generated/asm/local64.h
> WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
> WRAP arch/powerpc/include/generated/asm/preempt.h
> WRAP arch/powerpc/include/generated/asm/rwsem.h
> WRAP arch/powerpc/include/generated/asm/vtime.h
> CHK include/generated/uapi/linux/version.h
> UPD include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> UPD include/generated/utsrelease.h
> CC kernel/bounds.s
> CHK include/generated/bounds.h
> UPD include/generated/bounds.h
> CHK include/generated/timeconst.h
> UPD include/generated/timeconst.h
> CC arch/powerpc/kernel/asm-offsets.s
> CHK include/generated/asm-offsets.h
> UPD include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> HOSTCC scripts/dtc/dtc.o
> HOSTCC scripts/dtc/flattree.o
> HOSTCC scripts/dtc/fstree.o
> HOSTCC scripts/dtc/data.o
> HOSTCC scripts/dtc/livetree.o
> HOSTCC scripts/dtc/treesource.o
> HOSTCC scripts/dtc/srcpos.o
> HOSTCC scripts/dtc/checks.o
> HOSTCC scripts/dtc/util.o
> SHIPPED scripts/dtc/dtc-lexer.lex.c
> SHIPPED scripts/dtc/dtc-parser.tab.h
> HOSTCC scripts/dtc/dtc-lexer.lex.o
> SHIPPED scripts/dtc/dtc-parser.tab.c
> HOSTCC scripts/dtc/dtc-parser.tab.o
> HOSTLD scripts/dtc/dtc
> CC scripts/mod/empty.o
> HOSTCC scripts/mod/mk_elfconfig
> MKELF scripts/mod/elfconfig.h
> HOSTCC scripts/mod/modpost.o
> CC scripts/mod/devicetable-offsets.s
> GEN scripts/mod/devicetable-offsets.h
> HOSTCC scripts/mod/file2alias.o
> HOSTCC scripts/mod/sumversion.o
> HOSTLD scripts/mod/modpost
> HOSTCC scripts/kallsyms
> CC drivers/ata/sata_dwc_460ex.o
> drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
> drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
> ^
> mru@unicorn:/tmp/linux-sata$
>
> Patch file and .config attached.
>
> Looking into that warning, I doubt it works as is, but that's not caused
> by my patch. I can try to come up with a fix, but again, I can't test it.
>
I am using
make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-
Julian Margetson <[email protected]> writes:
> On 12/17/2015 8:06 PM, Måns Rullgård wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>
>>>>> On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>
>>>>>>> On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>>
>>>>>>>>> I have been running my machine mostly configured for pciex1 thus with
>>>>>>>>> the sata_dwc disabled.
>>>>>>>>> The changes to sata_dwc-460ex do cause an oops.
>>>>>>>>> I will try to give more detailed info over this weekend .
>>>>>>>> The driver as is upstream would do that since it unconditionally
>>>>>>>> dereferences a null pointer in the probe function. My patch fixes that
>>>>>>>> as a side-effect.
>>>>>>>>
>>>>>>> patching file drivers/ata/Kconfig
>>>>>>>
>>>>>>> Hunk #1 FAILED at 296.
>>>>>> [...]
>>>>>>
>>>>>>> root@julian-VirtualBox:/usr/src/linux-3.18.25#
>>>>>> The patch is against 4.4-rc5.
>>>>>>
>>>>> CC drivers/ata/sata_dwc_460ex.o
>>>>>
>>>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>>>
>>>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>>>> ^
>>>> It builds, albeit with an unrelated warning, using the attached config.
>>>> Maybe there's a missing config dependency somewhere.
>>>>
>>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>>> with your .config.
>>> 4.4.0-rc5 builds ok with no patches applied .
>>> Once your patch is applied it fails to build .
>>>
>>> CC drivers/ata/sata_dwc_460ex.o
>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>> ^
>> Bizarre. This is what it looks like here:
>>
>> mru@unicorn:/tmp/linux-sata$ git status
>> On branch sata-dwc
>> nothing to commit, working directory clean
>> mru@unicorn:/tmp/linux-sata$ git describe
>> v4.4-rc5
>> mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>> e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>> mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>> Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
>> mru@unicorn:/tmp/linux-sata$ sha1sum .config
>> 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
>> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
>> HOSTCC scripts/basic/fixdep
>> HOSTCC scripts/kconfig/conf.o
>> SHIPPED scripts/kconfig/zconf.tab.c
>> SHIPPED scripts/kconfig/zconf.lex.c
>> SHIPPED scripts/kconfig/zconf.hash.c
>> HOSTCC scripts/kconfig/zconf.tab.o
>> HOSTLD scripts/kconfig/conf
>> scripts/kconfig/conf --oldconfig Kconfig
>> #
>> # configuration written to .config
>> #
>> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- drivers/ata/sata_dwc_460ex.o
>> scripts/kconfig/conf --silentoldconfig Kconfig
[...]
>> CC drivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
>> drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>> dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
>> ^
>> mru@unicorn:/tmp/linux-sata$
>>
>> Patch file and .config attached.
>>
>> Looking into that warning, I doubt it works as is, but that's not caused
>> by my patch. I can try to come up with a fix, but again, I can't test it.
>>
> I am using
>
> make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-
Shouldn't matter since the compiler flags include -m32, and I only had a
powerpc64 toolchain built. Anyhow, I built a 32-bit toolchain and it
still builds.
Just to make sure you applied the patch correctly:
mru@unicorn:/tmp/linux-sata$ sha1sum drivers/ata/sata_dwc_460ex.c
c8a7927840aade75ac62b04a2c9acc8335a34d6f drivers/ata/sata_dwc_460ex.c
Digging deeper into that warning, it is clearly a bug which has always
been there. The reason it ever worked appears to be that the 460EX has
a dedicated DMA unit hard-wired to the SATA controller ignoring that
address. The situation is similar on my hardware.
--
Måns Rullgård
On Thu, 2015-12-17 at 17:41 -0400, Julian Margetson wrote:
> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
> > Julian Margetson <[email protected]> writes:
> >
> > > On 12/17/2015 2:51 PM, Måns Rullgård wrote:
> > > > Julian Margetson <[email protected]> writes:
> > > >
> > > > > On 12/17/2015 1:59 PM, Måns Rullgård wrote:
> > > > > > Julian Margetson <[email protected]> writes:
> > > > > >
> > > > > > > I have been running my machine mostly configured for
> > > > > > > pciex1 thus with
> > > > > > > the sata_dwc disabled.
> > > > > > > The changes to sata_dwc-460ex do cause an oops.
> > > > > > > I will try to give more detailed info over this weekend .
> > > > > > The driver as is upstream would do that since it
> > > > > > unconditionally
> > > > > > dereferences a null pointer in the probe function. My
> > > > > > patch fixes that
> > > > > > as a side-effect.
> > > > > >
> > > > > patching file drivers/ata/Kconfig
> > > > >
> > > > > Hunk #1 FAILED at 296.
> > > > [...]
> > > >
> > > > > root@julian-VirtualBox:/usr/src/linux-3.18.25#
> > > > The patch is against 4.4-rc5.
> > > >
> > > CC drivers/ata/sata_dwc_460ex.o
> > >
> > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
> > > ‘sata_dwc_dma_dws’ has initializer but incomplete type
> > >
> > > static struct dw_dma_slave sata_dwc_dma_dws = {
> > > ^
> > It builds, albeit with an unrelated warning, using the attached
> > config.
> > Maybe there's a missing config dependency somewhere.
> >
> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
> with your .config.
> 4.4.0-rc5 builds ok with no patches applied .
> Once your patch is applied it fails to build .
> CC drivers/ata/sata_dwc_460ex.o
> drivers/ata/sata_dwc_460ex.c:198:15: error: variable
> ‘sata_dwc_dma_dws’ has initializer but incomplete type
> static struct dw_dma_slave sata_dwc_dma_dws = {
> ^
> drivers/ata/sata_dwc_460ex.c:199:2: error: unknown field ‘src_id’
> specified in initializer
> .src_id = 0,
This clearly means that header file that defines the struct
dw_dma_slave is not included.
After the patch it seems you have to explicitly enable DW_DMAC, so,
either via make nconfig, or by adding
CONFIG_DW_DMAC=y
> ^
> drivers/ata/sata_dwc_460ex.c:199:2: warning: excess elements in
> struct initializer [enabled by default]
> drivers/ata/sata_dwc_460ex.c:199:2: warning: (near initialization for
> ‘sata_dwc_dma_dws’) [enabled by default]
> drivers/ata/sata_dwc_460ex.c:200:2: error: unknown field ‘dst_id’
> specified in initializer
> .dst_id = 0,
> ^
> drivers/ata/sata_dwc_460ex.c:200:2: warning: excess elements in
> struct initializer [enabled by default]
> drivers/ata/sata_dwc_460ex.c:200:2: warning: (near initialization for
> ‘sata_dwc_dma_dws’) [enabled by default]
> drivers/ata/sata_dwc_460ex.c:201:2: error: unknown field ‘src_master’
> specified in initializer
> .src_master = 0,
> ^
> drivers/ata/sata_dwc_460ex.c:201:2: warning: excess elements in
> struct initializer [enabled by default]
> drivers/ata/sata_dwc_460ex.c:201:2: warning: (near initialization for
> ‘sata_dwc_dma_dws’) [enabled by default]
> drivers/ata/sata_dwc_460ex.c:202:2: error: unknown field ‘dst_master’
> specified in initializer
> .dst_master = 1,
> ^
> drivers/ata/sata_dwc_460ex.c:202:2: warning: excess elements in
> struct initializer [enabled by default]
> drivers/ata/sata_dwc_460ex.c:202:2: warning: (near initialization for
> ‘sata_dwc_dma_dws’) [enabled by default]
> drivers/ata/sata_dwc_460ex.c: In function ‘dma_dwc_xfer_setup’:
> drivers/ata/sata_dwc_460ex.c:389:20: warning: cast from pointer to
> integer of different size [-Wpointer-to-int-cast]
> dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
> ^
> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_dma_filter’:
> drivers/ata/sata_dwc_460ex.c:872:9: error: dereferencing pointer to
> incomplete type
> if (dws->dma_dev != chan->device->dev)
> ^
> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_port_start’:
> drivers/ata/sata_dwc_460ex.c:958:13: error: dereferencing pointer to
> incomplete type
> hsdevp->dws->dma_dev = hsdev->dev;
> ^
> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_probe’:
> drivers/ata/sata_dwc_460ex.c:1330:12: error: dereferencing pointer to
> incomplete type
> hsdev->dma->irq = irq_of_parse_and_map(np, 1);
> ^
> drivers/ata/sata_dwc_460ex.c:1331:16: error: dereferencing pointer to
> incomplete type
> if (hsdev->dma->irq == NO_IRQ) {
> ^
> drivers/ata/sata_dwc_460ex.c:1338:12: error: dereferencing pointer to
> incomplete type
> hsdev->dma->regs = of_iomap(np, 1);
> ^
> drivers/ata/sata_dwc_460ex.c:1339:17: error: dereferencing pointer to
> incomplete type
> if (!hsdev->dma->regs) {
> ^
> drivers/ata/sata_dwc_460ex.c:1349:12: error: dereferencing pointer to
> incomplete type
> hsdev->dma->dev = &ofdev->dev;
> ^
> drivers/ata/sata_dwc_460ex.c:1352:2: error: implicit declaration of
> function ‘dw_dma_probe’ [-Werror=implicit-function-declaration]
> err = dw_dma_probe(hsdev->dma, NULL);
> ^
> drivers/ata/sata_dwc_460ex.c:1381:2: error: implicit declaration of
> function ‘dw_dma_remove’ [-Werror=implicit-function-declaration]
> dw_dma_remove(hsdev->dma);
> ^
> drivers/ata/sata_dwc_460ex.c:1383:20: error: dereferencing pointer to
> incomplete type
> iounmap(hsdev->dma->regs);
> ^
> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_remove’:
> drivers/ata/sata_dwc_460ex.c:1400:20: error: dereferencing pointer to
> incomplete type
> iounmap(hsdev->dma->regs);
> ^
> drivers/ata/sata_dwc_460ex.c: At top level:
> drivers/ata/sata_dwc_460ex.c:901:12: warning:
> ‘sata_dwc_dma_get_channel’ defined but not used [-Wunused-function]
> static int sata_dwc_dma_get_channel(struct sata_dwc_device_port
> *hsdevp)
> ^
> cc1: some warnings being treated as errors
> make[2]: *** [drivers/ata/sata_dwc_460ex.o] Error 1
> make[1]: *** [drivers/ata] Error 2
> make: *** [drivers] Error 2
> root@julian-VirtualBox:/usr/src/linux-4.4-rc5#
>
>
>
>
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Andy Shevchenko <[email protected]> writes:
> On Thu, 2015-12-17 at 17:41 -0400, Julian Margetson wrote:
>> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>> > Julian Margetson <[email protected]> writes:
>> >
>> > > On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>> > > > Julian Margetson <[email protected]> writes:
>> > > >
>> > > > > On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>> > > > > > Julian Margetson <[email protected]> writes:
>> > > > > >
>> > > > > > > I have been running my machine mostly configured for
>> > > > > > > pciex1 thus with
>> > > > > > > the sata_dwc disabled.
>> > > > > > > The changes to sata_dwc-460ex do cause an oops.
>> > > > > > > I will try to give more detailed info over this weekend .
>> > > > > > The driver as is upstream would do that since it
>> > > > > > unconditionally
>> > > > > > dereferences a null pointer in the probe function. My
>> > > > > > patch fixes that
>> > > > > > as a side-effect.
>> > > > > >
>> > > > > patching file drivers/ata/Kconfig
>> > > > >
>> > > > > Hunk #1 FAILED at 296.
>> > > > [...]
>> > > >
>> > > > > root@julian-VirtualBox:/usr/src/linux-3.18.25#
>> > > > The patch is against 4.4-rc5.
>> > > >
>> > > CC drivers/ata/sata_dwc_460ex.o
>> > >
>> > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
>> > > ‘sata_dwc_dma_dws’ has initializer but incomplete type
>> > >
>> > > static struct dw_dma_slave sata_dwc_dma_dws = {
>> > > ^
>> > It builds, albeit with an unrelated warning, using the attached
>> > config.
>> > Maybe there's a missing config dependency somewhere.
>> >
>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>> with your .config.
>> 4.4.0-rc5 builds ok with no patches applied .
>> Once your patch is applied it fails to build .
>> CC drivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable
>> ‘sata_dwc_dma_dws’ has initializer but incomplete type
>> static struct dw_dma_slave sata_dwc_dma_dws = {
>> ^
>> drivers/ata/sata_dwc_460ex.c:199:2: error: unknown field ‘src_id’
>> specified in initializer
>> .src_id = 0,
>
> This clearly means that header file that defines the struct
> dw_dma_slave is not included.
And yet two lines above there's this:
#include <linux/platform_data/dma-dw.h>
This unconditionally defines struct dw_dma_slave.
Moreover, the line number in the error message above does not match any
version of the file with my patches applied. I suspect something went
wrong when Julian patched his tree.
> After the patch it seems you have to explicitly enable DW_DMAC, so,
> either via make nconfig, or by adding
> CONFIG_DW_DMAC=y
The option for enabling the compatibility code selects DW_DMAC. There
is a missing select DMA_ENGINE, but that won't make any difference here,
and my .config has it enabled anyhow.
--
Måns Rullgård
On 12/17/2015 8:06 PM, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>
>>>>>> On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>
>>>>>>>> I have been running my machine mostly configured for pciex1 thus with
>>>>>>>> the sata_dwc disabled.
>>>>>>>> The changes to sata_dwc-460ex do cause an oops.
>>>>>>>> I will try to give more detailed info over this weekend .
>>>>>>> The driver as is upstream would do that since it unconditionally
>>>>>>> dereferences a null pointer in the probe function. My patch fixes that
>>>>>>> as a side-effect.
>>>>>>>
>>>>>> patching file drivers/ata/Kconfig
>>>>>>
>>>>>> Hunk #1 FAILED at 296.
>>>>> [...]
>>>>>
>>>>>> root@julian-VirtualBox:/usr/src/linux-3.18.25#
>>>>> The patch is against 4.4-rc5.
>>>>>
>>>> CC drivers/ata/sata_dwc_460ex.o
>>>>
>>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>>
>>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>>> ^
>>> It builds, albeit with an unrelated warning, using the attached config.
>>> Maybe there's a missing config dependency somewhere.
>>>
>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>> with your .config.
>> 4.4.0-rc5 builds ok with no patches applied .
>> Once your patch is applied it fails to build .
>>
>> CC drivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>> static struct dw_dma_slave sata_dwc_dma_dws = {
>> ^
> Bizarre. This is what it looks like here:
>
> mru@unicorn:/tmp/linux-sata$ git status
> On branch sata-dwc
> nothing to commit, working directory clean
> mru@unicorn:/tmp/linux-sata$ git describe
> v4.4-rc5
> mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
> mru@unicorn:/tmp/linux-sata$ sha1sum .config
> 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> SHIPPED scripts/kconfig/zconf.tab.c
> SHIPPED scripts/kconfig/zconf.lex.c
> SHIPPED scripts/kconfig/zconf.hash.c
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> scripts/kconfig/conf --oldconfig Kconfig
> #
> # configuration written to .config
> #
> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- drivers/ata/sata_dwc_460ex.o
> scripts/kconfig/conf --silentoldconfig Kconfig
> CHK include/config/kernel.release
> UPD include/config/kernel.release
> WRAP arch/powerpc/include/generated/asm/clkdev.h
> WRAP arch/powerpc/include/generated/asm/div64.h
> WRAP arch/powerpc/include/generated/asm/irq_regs.h
> WRAP arch/powerpc/include/generated/asm/irq_work.h
> WRAP arch/powerpc/include/generated/asm/local64.h
> WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
> WRAP arch/powerpc/include/generated/asm/preempt.h
> WRAP arch/powerpc/include/generated/asm/rwsem.h
> WRAP arch/powerpc/include/generated/asm/vtime.h
> CHK include/generated/uapi/linux/version.h
> UPD include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> UPD include/generated/utsrelease.h
> CC kernel/bounds.s
> CHK include/generated/bounds.h
> UPD include/generated/bounds.h
> CHK include/generated/timeconst.h
> UPD include/generated/timeconst.h
> CC arch/powerpc/kernel/asm-offsets.s
> CHK include/generated/asm-offsets.h
> UPD include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> HOSTCC scripts/dtc/dtc.o
> HOSTCC scripts/dtc/flattree.o
> HOSTCC scripts/dtc/fstree.o
> HOSTCC scripts/dtc/data.o
> HOSTCC scripts/dtc/livetree.o
> HOSTCC scripts/dtc/treesource.o
> HOSTCC scripts/dtc/srcpos.o
> HOSTCC scripts/dtc/checks.o
> HOSTCC scripts/dtc/util.o
> SHIPPED scripts/dtc/dtc-lexer.lex.c
> SHIPPED scripts/dtc/dtc-parser.tab.h
> HOSTCC scripts/dtc/dtc-lexer.lex.o
> SHIPPED scripts/dtc/dtc-parser.tab.c
> HOSTCC scripts/dtc/dtc-parser.tab.o
> HOSTLD scripts/dtc/dtc
> CC scripts/mod/empty.o
> HOSTCC scripts/mod/mk_elfconfig
> MKELF scripts/mod/elfconfig.h
> HOSTCC scripts/mod/modpost.o
> CC scripts/mod/devicetable-offsets.s
> GEN scripts/mod/devicetable-offsets.h
> HOSTCC scripts/mod/file2alias.o
> HOSTCC scripts/mod/sumversion.o
> HOSTLD scripts/mod/modpost
> HOSTCC scripts/kallsyms
> CC drivers/ata/sata_dwc_460ex.o
> drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
> drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
> ^
> mru@unicorn:/tmp/linux-sata$
>
> Patch file and .config attached.
>
> Looking into that warning, I doubt it works as is, but that's not caused
> by my patch. I can try to come up with a fix, but again, I can't test it.
>
Builds now. Using my own .config.
[ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version 1.82
[ 4.791186] scsi host0: sata-dwc
[ 4.794830] ata1: SATA max UDMA/133 irq 36
[ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA activate FIS
errata fix
[ 4.807959] scsi host1: sata_sil
[ 4.811662] scsi host2: sata_sil
[ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf
0xd84280080 irq 21
[ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf
0xd842800c0 irq 21
[ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem 0x4bffd0000
[ 5.206125] Unable to handle kernel paging request for data at
address 0x00000000
[ 5.228546] Faulting instruction address: 0xc043a2c8
[ 5.248577] Vector: 300 (Data Access) at [eddafae0]
[ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
[ 5.289439] lr: c0427c34: ata_qc_issue+0x338/0x3a0
[ 5.309708] sp: eddafb90
[ 5.327573] msr: 21000
[ 5.345108] dar: 0
[ 5.362242] dsisr: 0
[ 5.379257] current = 0xedda85c0
[ 5.397452] pid = 81, comm = scsi_eh_0
[ 5.416599] enter ? for help
[ 5.434346] [eddafbe0] c0427c34 ata_qc_issue+0x338/0x3a0
[ 5.454892] [eddafc10] c0427f0c ata_exec_internal_sg+0x270/0x47c
[ 5.476090] [eddafc80] c042818c ata_exec_internal+0x74/0x7c
[ 5.496645] [eddafcc0] c042839c ata_dev_read_id+0x150/0x4e0
[ 5.517001] [eddafd40] c0434b4c ata_eh_recover+0xfac/0x1088
[ 5.537210] [eddafdd0] c043516c ata_do_eh+0x4c/0x9c
[ 5.556724] [eddafe00] c0434e10 ata_scsi_port_error_handler+0x148/0x3a4
[ 5.578026] [eddafe30] c04350f0 ata_scsi_error+0x84/0xb4
[ 5.597878] [eddafe60] c0410844 scsi_error_handler+0xa4/0x44c
[ 5.618242] [eddafed0] c0038938 kthread+0xc8/0xcc
[ 5.637383] [eddaff40] c000ad90 ret_from_kernel_thread+0x5c/0x64
[ 5.657798] mon> <no input ...>
[ 7.675523] Oops: Kernel access of bad area, sig: 11 [#1]
[ 7.695357] PREEMPT Canyonlands
[ 7.712998] Modules linked in:
[ 7.730338] CPU: 0 PID: 81 Comm: scsi_eh_0 Not tainted
4.4.0-rc5-Sam460ex #2
[ 7.751933] task: edda85c0 ti: eddae000 task.ti: eddae000
[ 7.771844] NIP: c043a2c8 LR: c0427c34 CTR: c043a210
[ 7.791229] REGS: eddafae0 TRAP: 0300 Not tainted (4.4.0-rc5-Sam460ex)
[ 7.812519] MSR: 00021000 <CE,ME> CR: 24000022 XER: 20000000
[ 7.833197] DEAR: 00000000 ESR: 00000000
GPR00: c0427c34 eddafb90 edda85c0 00000000 00000000 00000000 ee3c1724
00000000
GPR08: ffffffff 00000004 00000002 eddafc10 22000022 00000000 00000001
c09314dc
GPR16: fafbfcfd 00000000 00000001 00000000 00000000 00029000 00000200
eddafc18
GPR24: 000000ec 00000000 00000000 edcba7d0 edcae200 00000000 ee3c0000
ee3c1700
[ 7.939668] NIP [c043a2c8] sata_dwc_qc_issue+0xb8/0x204
[ 7.959417] LR [c0427c34] ata_qc_issue+0x338/0x3a0
[ 7.978735] Call Trace:
[ 7.995605] [eddafb90] [00000006] 0x6 (unreliable)
[ 8.015009] [eddafbe0] [c0427c34] ata_qc_issue+0x338/0x3a0
[ 8.035078] [eddafc10] [c0427f0c] ata_exec_internal_sg+0x270/0x47c
[ 8.055763] [eddafc80] [c042818c] ata_exec_internal+0x74/0x7c
[ 8.075824] [eddafcc0] [c042839c] ata_dev_read_id+0x150/0x4e0
[ 8.095822] [eddafd40] [c0434b4c] ata_eh_recover+0xfac/0x1088
[ 8.115762] [eddafdd0] [c043516c] ata_do_eh+0x4c/0x9c
[ 8.134973] [eddafe00] [c0434e10] ata_scsi_port_error_handler+0x148/0x3a4
[ 8.155945] [eddafe30] [c04350f0] ata_scsi_error+0x84/0xb4
[ 8.175503] [eddafe60] [c0410844] scsi_error_handler+0xa4/0x44c
[ 8.195428] [eddafed0] [c0038938] kthread+0xc8/0xcc
[ 8.214218] [eddaff40] [c000ad90] ret_from_kernel_thread+0x5c/0x64
[ 8.234351] Instruction dump:
[ 8.251202] 91010018 9121001c 39200000 99210030 39200040 807c0104
91210028 9121002c
[ 8.273517] 39200004 91410008 91210020 91210024 <81230000> 81290084
2f890000 419e0010
[ 8.296123] ---[ end trace 63c0d319677b6964 ]---
[ 8.315133]
[ 8.330746] note: scsi_eh_0[81] exited with preempt_count 1
[ 8.402946] ata2.00: ATA-8: WDC WD5000AAKS-00V1A0, 05.01D05, max UDMA/133
[ 8.444867] ata2.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 0/32)
[ 8.474873] usb 1-1: new high-speed USB device number 2 using ppc-of-ehci
[ 8.521159] ata2.00: configured for UDMA/100
[ 11.324174] usb-storage 1-1.7:1.0: USB Mass Storage device detected
[ 11.351056] scsi host3: usb-storage 1-1.7:1.0
[ 12.377078] scsi 3:0:0:0: Direct-Access Generic Ultra HS-COMBO
1.98 PQ: 0 ANSI: 0
[ 12.406742] sd 3:0:0:0: Attached scsi generic sg0 type 0
[ 12.434765] sd 3:0:0:0: [sda] Attached SCSI removable disk
Boot ends here and wont go any further.
Julian Margetson <[email protected]> writes:
> On 12/17/2015 8:06 PM, Måns Rullgård wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>
>>>>> On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>
>>>>>>> On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>>
>>>>>>>>> I have been running my machine mostly configured for pciex1 thus with
>>>>>>>>> the sata_dwc disabled.
>>>>>>>>> The changes to sata_dwc-460ex do cause an oops.
>>>>>>>>> I will try to give more detailed info over this weekend .
>>>>>>>> The driver as is upstream would do that since it unconditionally
>>>>>>>> dereferences a null pointer in the probe function. My patch fixes that
>>>>>>>> as a side-effect.
>>>>>>>>
>>>>>>> patching file drivers/ata/Kconfig
>>>>>>>
>>>>>>> Hunk #1 FAILED at 296.
>>>>>> [...]
>>>>>>
>>>>>>> root@julian-VirtualBox:/usr/src/linux-3.18.25#
>>>>>> The patch is against 4.4-rc5.
>>>>>>
>>>>> CC drivers/ata/sata_dwc_460ex.o
>>>>>
>>>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>>>
>>>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>>>> ^
>>>> It builds, albeit with an unrelated warning, using the attached config.
>>>> Maybe there's a missing config dependency somewhere.
>>>>
>>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>>> with your .config.
>>> 4.4.0-rc5 builds ok with no patches applied .
>>> Once your patch is applied it fails to build .
>>>
>>> CC drivers/ata/sata_dwc_460ex.o
>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>> ^
>> Bizarre. This is what it looks like here:
>>
>> mru@unicorn:/tmp/linux-sata$ git status
>> On branch sata-dwc
>> nothing to commit, working directory clean
>> mru@unicorn:/tmp/linux-sata$ git describe
>> v4.4-rc5
>> mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>> e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>> mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>> Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
>> mru@unicorn:/tmp/linux-sata$ sha1sum .config
>> 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
>> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
>> HOSTCC scripts/basic/fixdep
>> HOSTCC scripts/kconfig/conf.o
>> SHIPPED scripts/kconfig/zconf.tab.c
>> SHIPPED scripts/kconfig/zconf.lex.c
>> SHIPPED scripts/kconfig/zconf.hash.c
>> HOSTCC scripts/kconfig/zconf.tab.o
>> HOSTLD scripts/kconfig/conf
>> scripts/kconfig/conf --oldconfig Kconfig
>> #
>> # configuration written to .config
>> #
>> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- drivers/ata/sata_dwc_460ex.o
>> scripts/kconfig/conf --silentoldconfig Kconfig
>> CHK include/config/kernel.release
>> UPD include/config/kernel.release
>> WRAP arch/powerpc/include/generated/asm/clkdev.h
>> WRAP arch/powerpc/include/generated/asm/div64.h
>> WRAP arch/powerpc/include/generated/asm/irq_regs.h
>> WRAP arch/powerpc/include/generated/asm/irq_work.h
>> WRAP arch/powerpc/include/generated/asm/local64.h
>> WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
>> WRAP arch/powerpc/include/generated/asm/preempt.h
>> WRAP arch/powerpc/include/generated/asm/rwsem.h
>> WRAP arch/powerpc/include/generated/asm/vtime.h
>> CHK include/generated/uapi/linux/version.h
>> UPD include/generated/uapi/linux/version.h
>> CHK include/generated/utsrelease.h
>> UPD include/generated/utsrelease.h
>> CC kernel/bounds.s
>> CHK include/generated/bounds.h
>> UPD include/generated/bounds.h
>> CHK include/generated/timeconst.h
>> UPD include/generated/timeconst.h
>> CC arch/powerpc/kernel/asm-offsets.s
>> CHK include/generated/asm-offsets.h
>> UPD include/generated/asm-offsets.h
>> CALL scripts/checksyscalls.sh
>> HOSTCC scripts/dtc/dtc.o
>> HOSTCC scripts/dtc/flattree.o
>> HOSTCC scripts/dtc/fstree.o
>> HOSTCC scripts/dtc/data.o
>> HOSTCC scripts/dtc/livetree.o
>> HOSTCC scripts/dtc/treesource.o
>> HOSTCC scripts/dtc/srcpos.o
>> HOSTCC scripts/dtc/checks.o
>> HOSTCC scripts/dtc/util.o
>> SHIPPED scripts/dtc/dtc-lexer.lex.c
>> SHIPPED scripts/dtc/dtc-parser.tab.h
>> HOSTCC scripts/dtc/dtc-lexer.lex.o
>> SHIPPED scripts/dtc/dtc-parser.tab.c
>> HOSTCC scripts/dtc/dtc-parser.tab.o
>> HOSTLD scripts/dtc/dtc
>> CC scripts/mod/empty.o
>> HOSTCC scripts/mod/mk_elfconfig
>> MKELF scripts/mod/elfconfig.h
>> HOSTCC scripts/mod/modpost.o
>> CC scripts/mod/devicetable-offsets.s
>> GEN scripts/mod/devicetable-offsets.h
>> HOSTCC scripts/mod/file2alias.o
>> HOSTCC scripts/mod/sumversion.o
>> HOSTLD scripts/mod/modpost
>> HOSTCC scripts/kallsyms
>> CC drivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
>> drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>> dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
>> ^
>> mru@unicorn:/tmp/linux-sata$
>>
>> Patch file and .config attached.
>>
>> Looking into that warning, I doubt it works as is, but that's not caused
>> by my patch. I can try to come up with a fix, but again, I can't test it.
>>
> Builds now. Using my own .config.
What changed?
> [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version 1.82
> [ 4.791186] scsi host0: sata-dwc
> [ 4.794830] ata1: SATA max UDMA/133 irq 36
> [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA activate FIS errata fix
> [ 4.807959] scsi host1: sata_sil
> [ 4.811662] scsi host2: sata_sil
> [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd84280080 irq 21
> [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd842800c0 irq 21
>
> [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
> [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem 0x4bffd0000
> [ 5.206125] Unable to handle kernel paging request for data at address 0x00000000
> [ 5.228546] Faulting instruction address: 0xc043a2c8
> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
Well, that's not good. Can you translate that address to a line of code?
--
Måns Rullgård
On Fri, 2015-12-18 at 12:04 +0000, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
> > On 12/17/2015 8:06 PM, Måns Rullgård wrote:
> > > Julian Margetson <[email protected]> writes:
> > >
> > > > On 12/17/2015 3:53 PM, Måns Rullgård wrote:
> > > > > Julian Margetson <[email protected]> writes:
> > > > >
> > > > > > On 12/17/2015 2:51 PM, Måns Rullgård wrote:
> > > > > > > Julian Margetson <[email protected]> writes:
> > > > > > >
> > > > > > > > On 12/17/2015 1:59 PM, Måns Rullgård wrote:
> > > > > > > > > Julian Margetson <[email protected]> writes:
> > > > > > > > >
> > > > > > > > > > I have been running my machine mostly configured
> > > > > > > > > > for pciex1 thus with
> > > > > > > > > > the sata_dwc disabled.
> > > > > > > > > > The changes to sata_dwc-460ex do cause an oops.
> > > > > > > > > > I will try to give more detailed info over this
> > > > > > > > > > weekend .
> > > > > > > > > The driver as is upstream would do that since it
> > > > > > > > > unconditionally
> > > > > > > > > dereferences a null pointer in the probe
> > > > > > > > > function. My patch fixes that
> > > > > > > > > as a side-effect.
> > > > > > > > >
> > > > > > > > patching file drivers/ata/Kconfig
> > > > > > > >
> > > > > > > > Hunk #1 FAILED at 296.
> > > > > > > [...]
> > > > > > >
> > > > > > > > root@julian-VirtualBox:/usr/src/linux-3.18.25#
> > > > > > > The patch is against 4.4-rc5.
> > > > > > >
> > > > > > CC drivers/ata/sata_dwc_460ex.o
> > > > > >
> > > > > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
> > > > > > ‘sata_dwc_dma_dws’ has initializer but incomplete type
> > > > > >
> > > > > > static struct dw_dma_slave sata_dwc_dma_dws = {
> > > > > > ^
> > > > > It builds, albeit with an unrelated warning, using the
> > > > > attached config.
> > > > > Maybe there's a missing config dependency somewhere.
> > > > >
> > > > I am attempting to cross compile under Ubuntu 14.04 X86 in
> > > > Virtualbox
> > > > with your .config.
> > > > 4.4.0-rc5 builds ok with no patches applied .
> > > > Once your patch is applied it fails to build .
> > > >
> > > > CC drivers/ata/sata_dwc_460ex.o
> > > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
> > > > ‘sata_dwc_dma_dws’ has initializer but incomplete type
> > > > static struct dw_dma_slave sata_dwc_dma_dws = {
> > > > ^
> > > Bizarre. This is what it looks like here:
> > >
> > > mru@unicorn:/tmp/linux-sata$ git status
> > > On branch sata-dwc
> > > nothing to commit, working directory clean
> > > mru@unicorn:/tmp/linux-sata$ git describe
> > > v4.4-rc5
> > > mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-
> > > sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> > > e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-
> > > sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> > > mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-
> > > use-dmas-DT-property-to-find-dma-.patch
> > > Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma
> > > channel
> > > mru@unicorn:/tmp/linux-sata$ sha1sum .config
> > > 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
> > > mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc
> > > CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
> > > HOSTCC scripts/basic/fixdep
> > > HOSTCC scripts/kconfig/conf.o
> > > SHIPPED scripts/kconfig/zconf.tab.c
> > > SHIPPED scripts/kconfig/zconf.lex.c
> > > SHIPPED scripts/kconfig/zconf.hash.c
> > > HOSTCC scripts/kconfig/zconf.tab.o
> > > HOSTLD scripts/kconfig/conf
> > > scripts/kconfig/conf --oldconfig Kconfig
> > > #
> > > # configuration written to .config
> > > #
> > > mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc
> > > CROSS_COMPILE=powerpc64-none-linux-gnu-
> > > drivers/ata/sata_dwc_460ex.o
> > > scripts/kconfig/conf --silentoldconfig Kconfig
> > > CHK include/config/kernel.release
> > > UPD include/config/kernel.release
> > > WRAP arch/powerpc/include/generated/asm/clkdev.h
> > > WRAP arch/powerpc/include/generated/asm/div64.h
> > > WRAP arch/powerpc/include/generated/asm/irq_regs.h
> > > WRAP arch/powerpc/include/generated/asm/irq_work.h
> > > WRAP arch/powerpc/include/generated/asm/local64.h
> > > WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
> > > WRAP arch/powerpc/include/generated/asm/preempt.h
> > > WRAP arch/powerpc/include/generated/asm/rwsem.h
> > > WRAP arch/powerpc/include/generated/asm/vtime.h
> > > CHK include/generated/uapi/linux/version.h
> > > UPD include/generated/uapi/linux/version.h
> > > CHK include/generated/utsrelease.h
> > > UPD include/generated/utsrelease.h
> > > CC kernel/bounds.s
> > > CHK include/generated/bounds.h
> > > UPD include/generated/bounds.h
> > > CHK include/generated/timeconst.h
> > > UPD include/generated/timeconst.h
> > > CC arch/powerpc/kernel/asm-offsets.s
> > > CHK include/generated/asm-offsets.h
> > > UPD include/generated/asm-offsets.h
> > > CALL scripts/checksyscalls.sh
> > > HOSTCC scripts/dtc/dtc.o
> > > HOSTCC scripts/dtc/flattree.o
> > > HOSTCC scripts/dtc/fstree.o
> > > HOSTCC scripts/dtc/data.o
> > > HOSTCC scripts/dtc/livetree.o
> > > HOSTCC scripts/dtc/treesource.o
> > > HOSTCC scripts/dtc/srcpos.o
> > > HOSTCC scripts/dtc/checks.o
> > > HOSTCC scripts/dtc/util.o
> > > SHIPPED scripts/dtc/dtc-lexer.lex.c
> > > SHIPPED scripts/dtc/dtc-parser.tab.h
> > > HOSTCC scripts/dtc/dtc-lexer.lex.o
> > > SHIPPED scripts/dtc/dtc-parser.tab.c
> > > HOSTCC scripts/dtc/dtc-parser.tab.o
> > > HOSTLD scripts/dtc/dtc
> > > CC scripts/mod/empty.o
> > > HOSTCC scripts/mod/mk_elfconfig
> > > MKELF scripts/mod/elfconfig.h
> > > HOSTCC scripts/mod/modpost.o
> > > CC scripts/mod/devicetable-offsets.s
> > > GEN scripts/mod/devicetable-offsets.h
> > > HOSTCC scripts/mod/file2alias.o
> > > HOSTCC scripts/mod/sumversion.o
> > > HOSTLD scripts/mod/modpost
> > > HOSTCC scripts/kallsyms
> > > CC drivers/ata/sata_dwc_460ex.o
> > > drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
> > > drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer
> > > to integer of different size [-Wpointer-to-int-cast]
> > > dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
> > > ^
> > > mru@unicorn:/tmp/linux-sata$
> > >
> > > Patch file and .config attached.
> > >
> > > Looking into that warning, I doubt it works as is, but that's not
> > > caused
> > > by my patch. I can try to come up with a fix, but again, I can't
> > > test it.
> > >
> > Builds now. Using my own .config.
>
> What changed?
(Just in case a hint: diffconfig helps to do the job)
>
> > [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version
> > 1.82
> > [ 4.791186] scsi host0: sata-dwc
> > [ 4.794830] ata1: SATA max UDMA/133 irq 36
> > [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA
> > activate FIS errata fix
> > [ 4.807959] scsi host1: sata_sil
> > [ 4.811662] scsi host2: sata_sil
> > [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf
> > 0xd84280080 irq 21
> > [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf
> > 0xd842800c0 irq 21
> >
> > [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl
> > 300)
> > [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl
> > 310)
> > [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem
> > 0x4bffd0000
> > [ 5.206125] Unable to handle kernel paging request for data at
> > address 0x00000000
> > [ 5.228546] Faulting instruction address: 0xc043a2c8
> > [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
> > [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>
> Well, that's not good. Can you translate that address to a line of
> code?
Besides that, can you enable DYNAMIC_DEBUG in the config and append
'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On 12/18/2015 8:04 AM, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/17/2015 8:06 PM, Måns Rullgård wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/17/2015 3:53 PM, Måns Rullgård wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>
>>>>>> On 12/17/2015 2:51 PM, Måns Rullgård wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>
>>>>>>>> On 12/17/2015 1:59 PM, Måns Rullgård wrote:
>>>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>>>
>>>>>>>>>> I have been running my machine mostly configured for pciex1 thus with
>>>>>>>>>> the sata_dwc disabled.
>>>>>>>>>> The changes to sata_dwc-460ex do cause an oops.
>>>>>>>>>> I will try to give more detailed info over this weekend .
>>>>>>>>> The driver as is upstream would do that since it unconditionally
>>>>>>>>> dereferences a null pointer in the probe function. My patch fixes that
>>>>>>>>> as a side-effect.
>>>>>>>>>
>>>>>>>> patching file drivers/ata/Kconfig
>>>>>>>>
>>>>>>>> Hunk #1 FAILED at 296.
>>>>>>> [...]
>>>>>>>
>>>>>>>> root@julian-VirtualBox:/usr/src/linux-3.18.25#
>>>>>>> The patch is against 4.4-rc5.
>>>>>>>
>>>>>> CC drivers/ata/sata_dwc_460ex.o
>>>>>>
>>>>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>>>>
>>>>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>>>>> ^
>>>>> It builds, albeit with an unrelated warning, using the attached config.
>>>>> Maybe there's a missing config dependency somewhere.
>>>>>
>>>> I am attempting to cross compile under Ubuntu 14.04 X86 in Virtualbox
>>>> with your .config.
>>>> 4.4.0-rc5 builds ok with no patches applied .
>>>> Once your patch is applied it fails to build .
>>>>
>>>> CC drivers/ata/sata_dwc_460ex.o
>>>> drivers/ata/sata_dwc_460ex.c:198:15: error: variable ‘sata_dwc_dma_dws’ has initializer but incomplete type
>>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>>> ^
>>> Bizarre. This is what it looks like here:
>>>
>>> mru@unicorn:/tmp/linux-sata$ git status
>>> On branch sata-dwc
>>> nothing to commit, working directory clean
>>> mru@unicorn:/tmp/linux-sata$ git describe
>>> v4.4-rc5
>>> mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>>> e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>>> mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
>>> Applying: ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
>>> mru@unicorn:/tmp/linux-sata$ sha1sum .config
>>> 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
>>> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
>>> HOSTCC scripts/basic/fixdep
>>> HOSTCC scripts/kconfig/conf.o
>>> SHIPPED scripts/kconfig/zconf.tab.c
>>> SHIPPED scripts/kconfig/zconf.lex.c
>>> SHIPPED scripts/kconfig/zconf.hash.c
>>> HOSTCC scripts/kconfig/zconf.tab.o
>>> HOSTLD scripts/kconfig/conf
>>> scripts/kconfig/conf --oldconfig Kconfig
>>> #
>>> # configuration written to .config
>>> #
>>> mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc CROSS_COMPILE=powerpc64-none-linux-gnu- drivers/ata/sata_dwc_460ex.o
>>> scripts/kconfig/conf --silentoldconfig Kconfig
>>> CHK include/config/kernel.release
>>> UPD include/config/kernel.release
>>> WRAP arch/powerpc/include/generated/asm/clkdev.h
>>> WRAP arch/powerpc/include/generated/asm/div64.h
>>> WRAP arch/powerpc/include/generated/asm/irq_regs.h
>>> WRAP arch/powerpc/include/generated/asm/irq_work.h
>>> WRAP arch/powerpc/include/generated/asm/local64.h
>>> WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
>>> WRAP arch/powerpc/include/generated/asm/preempt.h
>>> WRAP arch/powerpc/include/generated/asm/rwsem.h
>>> WRAP arch/powerpc/include/generated/asm/vtime.h
>>> CHK include/generated/uapi/linux/version.h
>>> UPD include/generated/uapi/linux/version.h
>>> CHK include/generated/utsrelease.h
>>> UPD include/generated/utsrelease.h
>>> CC kernel/bounds.s
>>> CHK include/generated/bounds.h
>>> UPD include/generated/bounds.h
>>> CHK include/generated/timeconst.h
>>> UPD include/generated/timeconst.h
>>> CC arch/powerpc/kernel/asm-offsets.s
>>> CHK include/generated/asm-offsets.h
>>> UPD include/generated/asm-offsets.h
>>> CALL scripts/checksyscalls.sh
>>> HOSTCC scripts/dtc/dtc.o
>>> HOSTCC scripts/dtc/flattree.o
>>> HOSTCC scripts/dtc/fstree.o
>>> HOSTCC scripts/dtc/data.o
>>> HOSTCC scripts/dtc/livetree.o
>>> HOSTCC scripts/dtc/treesource.o
>>> HOSTCC scripts/dtc/srcpos.o
>>> HOSTCC scripts/dtc/checks.o
>>> HOSTCC scripts/dtc/util.o
>>> SHIPPED scripts/dtc/dtc-lexer.lex.c
>>> SHIPPED scripts/dtc/dtc-parser.tab.h
>>> HOSTCC scripts/dtc/dtc-lexer.lex.o
>>> SHIPPED scripts/dtc/dtc-parser.tab.c
>>> HOSTCC scripts/dtc/dtc-parser.tab.o
>>> HOSTLD scripts/dtc/dtc
>>> CC scripts/mod/empty.o
>>> HOSTCC scripts/mod/mk_elfconfig
>>> MKELF scripts/mod/elfconfig.h
>>> HOSTCC scripts/mod/modpost.o
>>> CC scripts/mod/devicetable-offsets.s
>>> GEN scripts/mod/devicetable-offsets.h
>>> HOSTCC scripts/mod/file2alias.o
>>> HOSTCC scripts/mod/sumversion.o
>>> HOSTLD scripts/mod/modpost
>>> HOSTCC scripts/kallsyms
>>> CC drivers/ata/sata_dwc_460ex.o
>>> drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
>>> drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>>> dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
>>> ^
>>> mru@unicorn:/tmp/linux-sata$
>>>
>>> Patch file and .config attached.
>>>
>>> Looking into that warning, I doubt it works as is, but that's not caused
>>> by my patch. I can try to come up with a fix, but again, I can't test it.
>>>
>> Builds now. Using my own .config.
> What changed?
I may have messed up the patch initially .
>
>> [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version 1.82
>> [ 4.791186] scsi host0: sata-dwc
>> [ 4.794830] ata1: SATA max UDMA/133 irq 36
>> [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA activate FIS errata fix
>> [ 4.807959] scsi host1: sata_sil
>> [ 4.811662] scsi host2: sata_sil
>> [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd84280080 irq 21
>> [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd842800c0 irq 21
>>
>> [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
>> [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
>> [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem 0x4bffd0000
>> [ 5.206125] Unable to handle kernel paging request for data at address 0x00000000
>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
> Well, that's not good. Can you translate that address to a line of code?
>
need some guidance on method .
On Fri, 2015-12-18 at 08:33 -0400, Julian Margetson wrote:
> On 12/18/2015 8:04 AM, Måns Rullgård wrote:
> > Julian Margetson <[email protected]> writes:
> >
> > > On 12/17/2015 8:06 PM, Måns Rullgård wrote:
> > > > Julian Margetson <[email protected]> writes:
> > > >
> > > > > On 12/17/2015 3:53 PM, Måns Rullgård wrote:
> > > > > > Julian Margetson <[email protected]> writes:
> > > > > >
> > > > > > > On 12/17/2015 2:51 PM, Måns Rullgård wrote:
> > > > > > > > Julian Margetson <[email protected]> writes:
> > > > > > > >
> > > > > > > > > On 12/17/2015 1:59 PM, Måns Rullgård wrote:
> > > > > > > > > > Julian Margetson <[email protected]> writes:
> > > > > > > > > >
> > > > > > > > > > > I have been running my machine mostly configured
> > > > > > > > > > > for pciex1 thus with
> > > > > > > > > > > the sata_dwc disabled.
> > > > > > > > > > > The changes to sata_dwc-460ex do cause an oops.
> > > > > > > > > > > I will try to give more detailed info over this
> > > > > > > > > > > weekend .
> > > > > > > > > > The driver as is upstream would do that since it
> > > > > > > > > > unconditionally
> > > > > > > > > > dereferences a null pointer in the probe
> > > > > > > > > > function. My patch fixes that
> > > > > > > > > > as a side-effect.
> > > > > > > > > >
> > > > > > > > > patching file drivers/ata/Kconfig
> > > > > > > > >
> > > > > > > > > Hunk #1 FAILED at 296.
> > > > > > > > [...]
> > > > > > > >
> > > > > > > > > root@julian-VirtualBox:/usr/src/linux-3.18.25#
> > > > > > > > The patch is against 4.4-rc5.
> > > > > > > >
> > > > > > > CC drivers/ata/sata_dwc_460ex.o
> > > > > > >
> > > > > > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
> > > > > > > ‘sata_dwc_dma_dws’ has initializer but incomplete
> > > > > > > type
> > > > > > >
> > > > > > > static struct dw_dma_slave sata_dwc_dma_dws = {
> > > > > > > ^
> > > > > > It builds, albeit with an unrelated warning, using the
> > > > > > attached config.
> > > > > > Maybe there's a missing config dependency somewhere.
> > > > > >
> > > > > I am attempting to cross compile under Ubuntu 14.04 X86 in
> > > > > Virtualbox
> > > > > with your .config.
> > > > > 4.4.0-rc5 builds ok with no patches applied .
> > > > > Once your patch is applied it fails to build .
> > > > >
> > > > > CC drivers/ata/sata_dwc_460ex.o
> > > > > drivers/ata/sata_dwc_460ex.c:198:15: error: variable
> > > > > ‘sata_dwc_dma_dws’ has initializer but incomplete type
> > > > > static struct dw_dma_slave sata_dwc_dma_dws = {
> > > > > ^
> > > > Bizarre. This is what it looks like here:
> > > >
> > > > mru@unicorn:/tmp/linux-sata$ git status
> > > > On branch sata-dwc
> > > > nothing to commit, working directory clean
> > > > mru@unicorn:/tmp/linux-sata$ git describe
> > > > v4.4-rc5
> > > > mru@unicorn:/tmp/linux-sata$ sha1sum /tmp/0001-ata-
> > > > sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> > > > e300971aa483390f82de2e9120dc16e460e74feb /tmp/0001-ata-
> > > > sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> > > > mru@unicorn:/tmp/linux-sata$ git am /tmp/0001-ata-
> > > > sata_dwc_460ex-use-dmas-DT-property-to-find-dma-.patch
> > > > Applying: ata: sata_dwc_460ex: use "dmas" DT property to find
> > > > dma channel
> > > > mru@unicorn:/tmp/linux-sata$ sha1sum .config
> > > > 4e7615b8d2fa9a1c4b4ae9ffc363aefcaf3789ca .config
> > > > mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc
> > > > CROSS_COMPILE=powerpc64-none-linux-gnu- oldconfig
> > > > HOSTCC scripts/basic/fixdep
> > > > HOSTCC scripts/kconfig/conf.o
> > > > SHIPPED scripts/kconfig/zconf.tab.c
> > > > SHIPPED scripts/kconfig/zconf.lex.c
> > > > SHIPPED scripts/kconfig/zconf.hash.c
> > > > HOSTCC scripts/kconfig/zconf.tab.o
> > > > HOSTLD scripts/kconfig/conf
> > > > scripts/kconfig/conf --oldconfig Kconfig
> > > > #
> > > > # configuration written to .config
> > > > #
> > > > mru@unicorn:/tmp/linux-sata$ make ARCH=powerpc
> > > > CROSS_COMPILE=powerpc64-none-linux-gnu-
> > > > drivers/ata/sata_dwc_460ex.o
> > > > scripts/kconfig/conf --silentoldconfig Kconfig
> > > > CHK include/config/kernel.release
> > > > UPD include/config/kernel.release
> > > > WRAP arch/powerpc/include/generated/asm/clkdev.h
> > > > WRAP arch/powerpc/include/generated/asm/div64.h
> > > > WRAP arch/powerpc/include/generated/asm/irq_regs.h
> > > > WRAP arch/powerpc/include/generated/asm/irq_work.h
> > > > WRAP arch/powerpc/include/generated/asm/local64.h
> > > > WRAP arch/powerpc/include/generated/asm/mcs_spinlock.h
> > > > WRAP arch/powerpc/include/generated/asm/preempt.h
> > > > WRAP arch/powerpc/include/generated/asm/rwsem.h
> > > > WRAP arch/powerpc/include/generated/asm/vtime.h
> > > > CHK include/generated/uapi/linux/version.h
> > > > UPD include/generated/uapi/linux/version.h
> > > > CHK include/generated/utsrelease.h
> > > > UPD include/generated/utsrelease.h
> > > > CC kernel/bounds.s
> > > > CHK include/generated/bounds.h
> > > > UPD include/generated/bounds.h
> > > > CHK include/generated/timeconst.h
> > > > UPD include/generated/timeconst.h
> > > > CC arch/powerpc/kernel/asm-offsets.s
> > > > CHK include/generated/asm-offsets.h
> > > > UPD include/generated/asm-offsets.h
> > > > CALL scripts/checksyscalls.sh
> > > > HOSTCC scripts/dtc/dtc.o
> > > > HOSTCC scripts/dtc/flattree.o
> > > > HOSTCC scripts/dtc/fstree.o
> > > > HOSTCC scripts/dtc/data.o
> > > > HOSTCC scripts/dtc/livetree.o
> > > > HOSTCC scripts/dtc/treesource.o
> > > > HOSTCC scripts/dtc/srcpos.o
> > > > HOSTCC scripts/dtc/checks.o
> > > > HOSTCC scripts/dtc/util.o
> > > > SHIPPED scripts/dtc/dtc-lexer.lex.c
> > > > SHIPPED scripts/dtc/dtc-parser.tab.h
> > > > HOSTCC scripts/dtc/dtc-lexer.lex.o
> > > > SHIPPED scripts/dtc/dtc-parser.tab.c
> > > > HOSTCC scripts/dtc/dtc-parser.tab.o
> > > > HOSTLD scripts/dtc/dtc
> > > > CC scripts/mod/empty.o
> > > > HOSTCC scripts/mod/mk_elfconfig
> > > > MKELF scripts/mod/elfconfig.h
> > > > HOSTCC scripts/mod/modpost.o
> > > > CC scripts/mod/devicetable-offsets.s
> > > > GEN scripts/mod/devicetable-offsets.h
> > > > HOSTCC scripts/mod/file2alias.o
> > > > HOSTCC scripts/mod/sumversion.o
> > > > HOSTLD scripts/mod/modpost
> > > > HOSTCC scripts/kallsyms
> > > > CC drivers/ata/sata_dwc_460ex.o
> > > > drivers/ata/sata_dwc_460ex.c: In function 'dma_dwc_xfer_setup':
> > > > drivers/ata/sata_dwc_460ex.c:383:20: warning: cast from pointer
> > > > to integer of different size [-Wpointer-to-int-cast]
> > > > dma_addr_t addr = (dma_addr_t)&hsdev->sata_dwc_regs->dmadr;
> > > > ^
> > > > mru@unicorn:/tmp/linux-sata$
> > > >
> > > > Patch file and .config attached.
> > > >
> > > > Looking into that warning, I doubt it works as is, but that's
> > > > not caused
> > > > by my patch. I can try to come up with a fix, but again, I
> > > > can't test it.
> > > >
> > > Builds now. Using my own .config.
> > What changed?
> I may have messed up the patch initially .
> >
> > > [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version
> > > 1.82
> > > [ 4.791186] scsi host0: sata-dwc
> > > [ 4.794830] ata1: SATA max UDMA/133 irq 36
> > > [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA
> > > activate FIS errata fix
> > > [ 4.807959] scsi host1: sata_sil
> > > [ 4.811662] scsi host2: sata_sil
> > > [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf
> > > 0xd84280080 irq 21
> > > [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf
> > > 0xd842800c0 irq 21
> > >
> > > [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl
> > > 300)
> > > [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl
> > > 310)
> > > [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem
> > > 0x4bffd0000
> > > [ 5.206125] Unable to handle kernel paging request for data at
> > > address 0x00000000
> > > [ 5.228546] Faulting instruction address: 0xc043a2c8
> > > [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
> > > [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
> > Well, that's not good. Can you translate that address to a line of
> > code?
> >
> need some guidance on method .
Your toolchain has to have addr2line binary. It does a job if you
compile kernel with enough debug information (you may try to use make
CONFIG_DEBUG_INFO=y IIRC and then your specific addr2line binary).
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Julian Margetson <[email protected]> writes:
>>> Builds now. Using my own .config.
>> What changed?
> I may have messed up the patch initially .
Probably. Let's pretend it never happened.
>>> [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version 1.82
>>> [ 4.791186] scsi host0: sata-dwc
>>> [ 4.794830] ata1: SATA max UDMA/133 irq 36
>>> [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA activate FIS errata fix
>>> [ 4.807959] scsi host1: sata_sil
>>> [ 4.811662] scsi host2: sata_sil
>>> [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd84280080 irq 21
>>> [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd842800c0 irq 21
>>>
>>> [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
>>> [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
>>> [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem 0x4bffd0000
>>> [ 5.206125] Unable to handle kernel paging request for data at address 0x00000000
>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>> Well, that's not good. Can you translate that address to a line of code?
>>
> need some guidance on method .
Enable CONFIG_DEBUG_INFO, then use this command:
$ addr2line -e vmlinux 0xc043a2c8
Obviously substitute the actual crashing address if it changes.
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
>> > [????5.206125] Unable to handle kernel paging request for data at
>> > address 0x00000000
>> > [????5.228546] Faulting instruction address: 0xc043a2c8
>> > [????5.248577] Vector: 300 (Data Access) at [eddafae0]
>> > [????5.268658]?????pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>
>> Well, that's not good.??Can you translate that address to a line of
>> code?
>
> Besides that, can you enable DYNAMIC_DEBUG in the config and append
> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
Enabling debug messages in the sata_dwc driver might also be informative.
--
M?ns Rullg?rd
On Fri, 2015-12-18 at 09:52 -0400, Julian Margetson wrote:
> On 12/18/2015 8:45 AM, Måns Rullgård wrote:
> > Julian Margetson <[email protected]> writes:
> > > > > [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller
> > > > > version 1.82
> > > > > [ 4.791186] scsi host0: sata-dwc
> > > > > [ 4.794830] ata1: SATA max UDMA/133 irq 36
> > > > > [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA
> > > > > activate FIS errata fix
> > > > > [ 4.807959] scsi host1: sata_sil
> > > > > [ 4.811662] scsi host2: sata_sil
> > > > > [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000
> > > > > tf 0xd84280080 irq 21
> > > > > [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000
> > > > > tf 0xd842800c0 irq 21
> > > > >
> > > > > [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123
> > > > > SControl 300)
> > > > > [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113
> > > > > SControl 310)
> > > > > [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem
> > > > > 0x4bffd0000
> > > > > [ 5.206125] Unable to handle kernel paging request for
> > > > > data at address 0x00000000
> > > > > [ 5.228546] Faulting instruction address: 0xc043a2c8
> > > > > [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
> > > > > [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
> > > > Well, that's not good. Can you translate that address to a
> > > > line of code?
> > > >
> > > need some guidance on method .
> > Enable CONFIG_DEBUG_INFO, then use this command:
> >
> > $ addr2line -e vmlinux 0xc043a2c8
> >
> > Obviously substitute the actual crashing address if it changes.
> >
> addr2line -e vmlinux 0xc044b41c
> arch/powerpc/lib/copy_32.S:?
memcpy I suppose. Might be copy to unmapped memory.
Anyway, can you enable debug options as I suggested including debug for
sata driver ('dw_dmac_core.dyndbg dw_dmac.dyndbg sata_dwc_460ex.dydbg'
to the cmdline and CONFIG_DYNAMIC_DEBUG=y)?
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Julian Margetson <[email protected]> writes:
> On 12/18/2015 8:45 AM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>>>> Builds now. Using my own .config.
>>>> What changed?
>>> I may have messed up the patch initially .
>> Probably. Let's pretend it never happened.
>>
>>>>> [ 4.784199] sata-dwc 4bffd1000.sata: id 0, controller version 1.82
>>>>> [ 4.791186] scsi host0: sata-dwc
>>>>> [ 4.794830] ata1: SATA max UDMA/133 irq 36
>>>>> [ 4.799463] sata_sil 0001:00:04.0: Applying R_ERR on DMA activate FIS errata fix
>>>>> [ 4.807959] scsi host1: sata_sil
>>>>> [ 4.811662] scsi host2: sata_sil
>>>>> [ 4.815242] ata2: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd84280080 irq 21
>>>>> [ 4.822990] ata3: SATA max UDMA/100 mmio m512@0xd84280000 tf 0xd842800c0 irq 21
>>>>>
>>>>> [ 5.143502] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
>>>>> [ 5.164367] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
>>>>> [ 5.185174] ppc-of-ohci 4bffd0000.usb: irq 32, io mem 0x4bffd0000
>>>>> [ 5.206125] Unable to handle kernel paging request for data at address 0x00000000
>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>> Well, that's not good. Can you translate that address to a line of code?
>>>>
>>> need some guidance on method .
>> Enable CONFIG_DEBUG_INFO, then use this command:
>>
>> $ addr2line -e vmlinux 0xc043a2c8
>>
>> Obviously substitute the actual crashing address if it changes.
>>
> addr2line -e vmlinux 0xc044b41c
> arch/powerpc/lib/copy_32.S:?
There's obviously a mismatch somewhere since we know that
sata_dwc_qc_issue isn't in copy_32.S. Please post the full crash report
you got this address from.
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/18/2015 8:49 AM, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>> address 0x00000000
>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>> Well, that's not good. Can you translate that address to a line of
>>>> code?
>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>> Enabling debug messages in the sata_dwc driver might also be informative.
>>
> Changed the sata-dwc to a module .
>
> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
That's strange. The only way that can happen is if
dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
happening. Did you turn on debug messages in dw_dma? You can enable
some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
of drivers/dma/dw/core.c
--
M?ns Rullg?rd
On Fri, 2015-12-18 at 17:18 +0000, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
> > On 12/18/2015 8:49 AM, Måns Rullgård wrote:
> > > Andy Shevchenko <[email protected]> writes:
> > >
> > > > > > [ 5.206125] Unable to handle kernel paging request for
> > > > > > data at
> > > > > > address 0x00000000
> > > > > > [ 5.228546] Faulting instruction address: 0xc043a2c8
> > > > > > [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
> > > > > > [ 5.268658] pc: c043a2c8:
> > > > > > sata_dwc_qc_issue+0xb8/0x204
> > > > > Well, that's not good. Can you translate that address to a
> > > > > line of
> > > > > code?
> > > > Besides that, can you enable DYNAMIC_DEBUG in the config and
> > > > append
> > > > 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
> > > Enabling debug messages in the sata_dwc driver might also be
> > > informative.
> > >
> > Changed the sata-dwc to a module .
> >
> > [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag:
> > dma_dwc_xfer_setup returns NULL
> > [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag:
> > dma_dwc_xfer_setup returns NULL
>
> That's strange. The only way that can happen is if
> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
> happening. Did you turn on debug messages in dw_dma? You can enable
> some extra debug messages by adding "#define VERBOSE_DEBUG" at the
> top
> of drivers/dma/dw/core.c
There are options also for DMA Engine such as CONFIG_DMADEVICES_DEBUG
>
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Julian Margetson <[email protected]> writes:
> On 12/18/2015 1:18 PM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/18/2015 8:49 AM, M?ns Rullg?rd wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>>>> address 0x00000000
>>>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>>>> Well, that's not good. Can you translate that address to a line of
>>>>>> code?
>>>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>>>> Enabling debug messages in the sata_dwc driver might also be informative.
>>>>
>>> Changed the sata-dwc to a module .
>>>
>>> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> That's strange. The only way that can happen is if
>> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
>> happening. Did you turn on debug messages in dw_dma? You can enable
>> some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
>> of drivers/dma/dw/core.c
>>
>
> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
Could you post the entire kernel log? There might be important
information before the errors start.
--
M?ns Rullg?rd
On 12/18/2015 6:33 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/18/2015 1:18 PM, M?ns Rullg?rd wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/18/2015 8:49 AM, M?ns Rullg?rd wrote:
>>>>> Andy Shevchenko <[email protected]> writes:
>>>>>
>>>>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>>>>> address 0x00000000
>>>>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>>>>> Well, that's not good. Can you translate that address to a line of
>>>>>>> code?
>>>>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>>>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>>>>> Enabling debug messages in the sata_dwc driver might also be informative.
>>>>>
>>>> Changed the sata-dwc to a module .
>>>>
>>>> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> That's strange. The only way that can happen is if
>>> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
>>> happening. Did you turn on debug messages in dw_dma? You can enable
>>> some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
>>> of drivers/dma/dw/core.c
>>>
>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
> Could you post the entire kernel log? There might be important
> information before the errors start.
>
Julian Margetson <[email protected]> writes:
> On 12/18/2015 6:33 PM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/18/2015 1:18 PM, M?ns Rullg?rd wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>
>>>>> On 12/18/2015 8:49 AM, M?ns Rullg?rd wrote:
>>>>>> Andy Shevchenko <[email protected]> writes:
>>>>>>
>>>>>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>>>>>> address 0x00000000
>>>>>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>>>>>> Well, that's not good. Can you translate that address to a line of
>>>>>>>> code?
>>>>>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>>>>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>>>>>> Enabling debug messages in the sata_dwc driver might also be informative.
>>>>>>
>>>>> Changed the sata-dwc to a module .
>>>>>
>>>>> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> That's strange. The only way that can happen is if
>>>> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
>>>> happening. Did you turn on debug messages in dw_dma? You can enable
>>>> some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
>>>> of drivers/dma/dw/core.c
>>>>
>>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> Could you post the entire kernel log? There might be important
>> information before the errors start.
>>
>
>
> =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.12.18 15:01:48 =~=~=~=~=~=~=~=~=~=~=~=
> [ 0.000000] Using Canyonlands machine description
> [ 0.000000] Initializing cgroup subsys cpu
> [ 0.000000] Linux version 4.4.0-rc5-Sam460ex (root@julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #8 PREEMPT Fri Dec 18 13:36:34 AST 2015
> [ 0.000000] Zone ranges:
> [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
> [ 0.000000] Normal empty
> [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff]
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
> [ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752
> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200 console=tty0 dw_dmac_core.dyndbg dw_dmac.dyndbg
[...]
> [ 13.643415] systemd[1]: Mounted Configuration File System.
> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
This log is weird. The sata_dwc_probe() function prints several things
(one using dev_notice()), for instance this:
/* Read the ID and Version Registers */
idr = in_le32(&hsdev->sata_dwc_regs->idr);
versionr = in_le32(&hsdev->sata_dwc_regs->versionr);
dev_notice(&ofdev->dev, "id %d, controller version %c.%c%c\n",
idr, ver[0], ver[1], ver[2]);
The dw_dma_probe() function also prints a line:
dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
pdata->nr_channels);
These messages are nowhere to be seen in your log, nor are numerous
others that really must appear before before sata_dwc_qc_prep_by_tag()
can be called.
I'd like to note that the driver works on my Sigma Designs based system
using a different DMA controller, so it's not completely broken. The
DMA driver could still be faulty, but that still doesn't explain the
missing kernel messages.
--
M?ns Rullg?rd
On Sat, Dec 19, 2015 at 1:16 AM, Måns Rullgård <[email protected]> wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/18/2015 6:33 PM, Måns Rullgård wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/18/2015 1:18 PM, Måns Rullgård wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>
>>>>>> On 12/18/2015 8:49 AM, Måns Rullgård wrote:
>>>>>>> Andy Shevchenko <[email protected]> writes:
>>>>>>>
>>>>>>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>>>>>>> address 0x00000000
>>>>>>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>>>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>>>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>>>>>>> Well, that's not good. Can you translate that address to a line of
>>>>>>>>> code?
>>>>>>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>>>>>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>>>>>>> Enabling debug messages in the sata_dwc driver might also be informative.
>>>>>>>
>>>>>> Changed the sata-dwc to a module .
>>>>>>
>>>>>> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>> That's strange. The only way that can happen is if
>>>>> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
>>>>> happening. Did you turn on debug messages in dw_dma? You can enable
>>>>> some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
>>>>> of drivers/dma/dw/core.c
>>>>>
>>>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> Could you post the entire kernel log? There might be important
>>> information before the errors start.
>>>
>>
>>
>> =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.12.18 15:01:48 =~=~=~=~=~=~=~=~=~=~=~=
>> [ 0.000000] Using Canyonlands machine description
>> [ 0.000000] Initializing cgroup subsys cpu
>> [ 0.000000] Linux version 4.4.0-rc5-Sam460ex (root@julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #8 PREEMPT Fri Dec 18 13:36:34 AST 2015
>> [ 0.000000] Zone ranges:
>> [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
>> [ 0.000000] Normal empty
>> [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff]
>> [ 0.000000] Movable zone start for each node
>> [ 0.000000] Early memory node ranges
>> [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
>> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
>> [ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
>> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752
>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200 console=tty0 dw_dmac_core.dyndbg dw_dmac.dyndbg
I would suggest to use console=tty1 instead of console=tty0.
>
> [...]
>
>> [ 13.643415] systemd[1]: Mounted Configuration File System.
>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>
> This log is weird. The sata_dwc_probe() function prints several things
> (one using dev_notice()), for instance this:
>
> /* Read the ID and Version Registers */
> idr = in_le32(&hsdev->sata_dwc_regs->idr);
> versionr = in_le32(&hsdev->sata_dwc_regs->versionr);
> dev_notice(&ofdev->dev, "id %d, controller version %c.%c%c\n",
> idr, ver[0], ver[1], ver[2]);
>
> The dw_dma_probe() function also prints a line:
>
> dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
> pdata->nr_channels);
>
> These messages are nowhere to be seen in your log, nor are numerous
> others that really must appear before before sata_dwc_qc_prep_by_tag()
> can be called.
>
It would be better to add 'ignore_loglevel' to the cmdline as well.
> I'd like to note that the driver works on my Sigma Designs based system
> using a different DMA controller, so it's not completely broken. The
> DMA driver could still be faulty, but that still doesn't explain the
> missing kernel messages.
>
> --
> Måns Rullgård
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
With Best Regards,
Andy Shevchenko
On 12/18/2015 10:34 PM, Andy Shevchenko wrote:
> On Sat, Dec 19, 2015 at 1:16 AM, Måns Rullgård <[email protected]> wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/18/2015 6:33 PM, Måns Rullgård wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>
>>>>> On 12/18/2015 1:18 PM, Måns Rullgård wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>
>>>>>>> On 12/18/2015 8:49 AM, Måns Rullgård wrote:
>>>>>>>> Andy Shevchenko <[email protected]> writes:
>>>>>>>>
>>>>>>>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>>>>>>>> address 0x00000000
>>>>>>>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>>>>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>>>>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>>>>>>>> Well, that's not good. Can you translate that address to a line of
>>>>>>>>>> code?
>>>>>>>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>>>>>>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>>>>>>>> Enabling debug messages in the sata_dwc driver might also be informative.
>>>>>>>>
>>>>>>> Changed the sata-dwc to a module .
>>>>>>>
>>>>>>> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>>> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>> That's strange. The only way that can happen is if
>>>>>> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
>>>>>> happening. Did you turn on debug messages in dw_dma? You can enable
>>>>>> some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
>>>>>> of drivers/dma/dw/core.c
>>>>>>
>>>>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> Could you post the entire kernel log? There might be important
>>>> information before the errors start.
>>>>
>>>
>>> =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.12.18 15:01:48 =~=~=~=~=~=~=~=~=~=~=~=
>>> [ 0.000000] Using Canyonlands machine description
>>> [ 0.000000] Initializing cgroup subsys cpu
>>> [ 0.000000] Linux version 4.4.0-rc5-Sam460ex (root@julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #8 PREEMPT Fri Dec 18 13:36:34 AST 2015
>>> [ 0.000000] Zone ranges:
>>> [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
>>> [ 0.000000] Normal empty
>>> [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff]
>>> [ 0.000000] Movable zone start for each node
>>> [ 0.000000] Early memory node ranges
>>> [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
>>> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
>>> [ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
>>> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752
>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200 console=tty0 dw_dmac_core.dyndbg dw_dmac.dyndbg
> I would suggest to use console=tty1 instead of console=tty0.
>
>> [...]
>>
>>> [ 13.643415] systemd[1]: Mounted Configuration File System.
>>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>> This log is weird. The sata_dwc_probe() function prints several things
>> (one using dev_notice()), for instance this:
>>
>> /* Read the ID and Version Registers */
>> idr = in_le32(&hsdev->sata_dwc_regs->idr);
>> versionr = in_le32(&hsdev->sata_dwc_regs->versionr);
>> dev_notice(&ofdev->dev, "id %d, controller version %c.%c%c\n",
>> idr, ver[0], ver[1], ver[2]);
>>
>> The dw_dma_probe() function also prints a line:
>>
>> dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
>> pdata->nr_channels);
>>
>> These messages are nowhere to be seen in your log, nor are numerous
>> others that really must appear before before sata_dwc_qc_prep_by_tag()
>> can be called.
>>
> It would be better to add 'ignore_loglevel' to the cmdline as well.
>
>> I'd like to note that the driver works on my Sigma Designs based system
>> using a different DMA controller, so it's not completely broken. The
>> DMA driver could still be faulty, but that still doesn't explain the
>> missing kernel messages.
>>
>> --
>> Måns Rullgård
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
>
Julian Margetson <[email protected]> writes:
> On 12/18/2015 10:34 PM, Andy Shevchenko wrote:
>> On Sat, Dec 19, 2015 at 1:16 AM, M?ns Rullg?rd <[email protected]> wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/18/2015 6:33 PM, M?ns Rullg?rd wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>
>>>>>> On 12/18/2015 1:18 PM, M?ns Rullg?rd wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>
>>>>>>>> On 12/18/2015 8:49 AM, M?ns Rullg?rd wrote:
>>>>>>>>> Andy Shevchenko <[email protected]> writes:
>>>>>>>>>
>>>>>>>>>>>> [ 5.206125] Unable to handle kernel paging request for data at
>>>>>>>>>>>> address 0x00000000
>>>>>>>>>>>> [ 5.228546] Faulting instruction address: 0xc043a2c8
>>>>>>>>>>>> [ 5.248577] Vector: 300 (Data Access) at [eddafae0]
>>>>>>>>>>>> [ 5.268658] pc: c043a2c8: sata_dwc_qc_issue+0xb8/0x204
>>>>>>>>>>> Well, that's not good. Can you translate that address to a line of
>>>>>>>>>>> code?
>>>>>>>>>> Besides that, can you enable DYNAMIC_DEBUG in the config and append
>>>>>>>>>> 'dw_dmac_core.dyndbg dw_dmac.dyndbg' to the kernel cmdline?
>>>>>>>>> Enabling debug messages in the sata_dwc driver might also be informative.
>>>>>>>>>
>>>>>>>> Changed the sata-dwc to a module .
>>>>>>>>
>>>>>>>> [ 18.475140] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>>>> [ 18.535698] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>>> That's strange. The only way that can happen is if
>>>>>>> dmaengine_prep_slave_sg() return NULL, and that really shouldn't be
>>>>>>> happening. Did you turn on debug messages in dw_dma? You can enable
>>>>>>> some extra debug messages by adding "#define VERBOSE_DEBUG" at the top
>>>>>>> of drivers/dma/dw/core.c
>>>>>>>
>>>>>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>>> Could you post the entire kernel log? There might be important
>>>>> information before the errors start.
>>>>>
>>>>
>>>> =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.12.18 15:01:48 =~=~=~=~=~=~=~=~=~=~=~=
>>>> [ 0.000000] Using Canyonlands machine description
>>>> [ 0.000000] Initializing cgroup subsys cpu
>>>> [ 0.000000] Linux version 4.4.0-rc5-Sam460ex (root@julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #8 PREEMPT Fri Dec 18 13:36:34 AST 2015
>>>> [ 0.000000] Zone ranges:
>>>> [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
>>>> [ 0.000000] Normal empty
>>>> [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff]
>>>> [ 0.000000] Movable zone start for each node
>>>> [ 0.000000] Early memory node ranges
>>>> [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
>>>> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
>>>> [ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
>>>> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752
>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200 console=tty0 dw_dmac_core.dyndbg dw_dmac.dyndbg
>> I would suggest to use console=tty1 instead of console=tty0.
>>
>>> [...]
>>>
>>>> [ 13.643415] systemd[1]: Mounted Configuration File System.
>>>> [ 17.526173] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> [ 17.600124] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>>> [ 17.662978] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: dma_dwc_xfer_setup returns NULL
>>> This log is weird. The sata_dwc_probe() function prints several things
>>> (one using dev_notice()), for instance this:
>>>
>>> /* Read the ID and Version Registers */
>>> idr = in_le32(&hsdev->sata_dwc_regs->idr);
>>> versionr = in_le32(&hsdev->sata_dwc_regs->versionr);
>>> dev_notice(&ofdev->dev, "id %d, controller version %c.%c%c\n",
>>> idr, ver[0], ver[1], ver[2]);
>>>
>>> The dw_dma_probe() function also prints a line:
>>>
>>> dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
>>> pdata->nr_channels);
>>>
>>> These messages are nowhere to be seen in your log, nor are numerous
>>> others that really must appear before before sata_dwc_qc_prep_by_tag()
>>> can be called.
>>>
>> It would be better to add 'ignore_loglevel' to the cmdline as well.
OK, I've found something. The dma setup errors are benign, caused by
the driver calling dmaengine_prep_slave_sg() even for non-dma
operations. The real error is the lock recursion that's reported
later. I wasn't seeing it since I was running a UP non-preempt kernel.
With lock debugging enabled, I get the same error. This patch should
fix it.
---8<---
>From 94c4769d2171ce66079fd486a45e09dd64db62c0 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <[email protected]>
Date: Sat, 19 Dec 2015 15:26:23 +0000
Subject: [PATCH] ata: sata_dwc_460ex: remove incorrect locking
This lock is already taken in ata_scsi_queuecmd() a few levels up the
call stack so attempting to take it here is an error. Moreover, it is
pointless in the first place since it only protects a single, atomic
assignment.
Signed-off-by: Mans Rullgard <[email protected]>
---
drivers/ata/sata_dwc_460ex.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 799df86..5696f39 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1001,16 +1001,14 @@ static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
struct ata_taskfile *tf,
u8 tag, u32 cmd_issued)
{
- unsigned long flags;
struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
dev_dbg(ap->dev, "%s cmd(0x%02x): %s tag=%d\n", __func__, tf->command,
ata_get_cmd_descript(tf->command), tag);
- spin_lock_irqsave(&ap->host->lock, flags);
hsdevp->cmd_issued[tag] = cmd_issued;
- spin_unlock_irqrestore(&ap->host->lock, flags);
+
/*
* Clear SError before executing a new command.
* sata_dwc_scr_write and read can not be used here. Clearing the PM
--
2.6.3
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/19/2015 11:40 AM, M?ns Rullg?rd wrote:
>> OK, I've found something. The dma setup errors are benign, caused by
>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>> operations. The real error is the lock recursion that's reported
>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>> With lock debugging enabled, I get the same error. This patch should
>> fix it.
>>
>> ---8<---
>> >From 94c4769d2171ce66079fd486a45e09dd64db62c0 Mon Sep 17 00:00:00 2001
>> From: Mans Rullgard<[email protected]>
>> Date: Sat, 19 Dec 2015 15:26:23 +0000
>> Subject: [PATCH] ata: sata_dwc_460ex: remove incorrect locking
>>
>> This lock is already taken in ata_scsi_queuecmd() a few levels up the
>> call stack so attempting to take it here is an error. Moreover, it is
>> pointless in the first place since it only protects a single, atomic
>> assignment.
>>
>> Signed-off-by: Mans Rullgard<[email protected]>
>> ---
>> drivers/ata/sata_dwc_460ex.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
>> index 799df86..5696f39 100644
>> --- a/drivers/ata/sata_dwc_460ex.c
>> +++ b/drivers/ata/sata_dwc_460ex.c
>> @@ -1001,16 +1001,14 @@ static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
>> struct ata_taskfile *tf,
>> u8 tag, u32 cmd_issued)
>> {
>> - unsigned long flags;
>> struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
>> struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
>> dev_dbg(ap->dev, "%s cmd(0x%02x): %s tag=%d\n", __func__,
>> tf->command,
>> ata_get_cmd_descript(tf->command), tag);
>> - spin_lock_irqsave(&ap->host->lock, flags);
>> hsdevp->cmd_issued[tag] = cmd_issued;
>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>> +
>> /*
>> * Clear SError before executing a new command.
>> * sata_dwc_scr_write and read can not be used here. Clearing the PM
> having a problem applying the patch .
>
> patching file drivers/ata/sata_dwc_460ex.c
> Hunk #1 FAILED at 1001 (different line endings).
OK, attaching it instead.
--
M?ns Rullg?rd
On Sat, Dec 19, 2015 at 5:40 PM, Måns Rullgård <[email protected]> wrote:
> OK, I've found something. The dma setup errors are benign, caused by
> the driver calling dmaengine_prep_slave_sg() even for non-dma
> operations.
I suppose the following is a quick fix to avoid preparing descriptor
for non-DMA operations (not tested anyhow)
a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
ata_queued_cmd *qc, u8 tag)
__func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
qc->n_elem);
+ if (!is_slave_direction(qc->dma_dir))
+ return;
+
desc = dma_dwc_xfer_setup(qc);
if (!desc) {
dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
> The real error is the lock recursion that's reported
> later. I wasn't seeing it since I was running a UP non-preempt kernel.
> With lock debugging enabled, I get the same error. This patch should
> fix it.
> - spin_lock_irqsave(&ap->host->lock, flags);
> hsdevp->cmd_issued[tag] = cmd_issued;
> - spin_unlock_irqrestore(&ap->host->lock, flags);
> +
This will create a second empty line, though I don't care it is so minor.
--
With Best Regards,
Andy Shevchenko
Andy Shevchenko <[email protected]> writes:
> On Sat, Dec 19, 2015 at 5:40 PM, M?ns Rullg?rd <[email protected]> wrote:
>
>> OK, I've found something. The dma setup errors are benign, caused by
>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>> operations.
>
> I suppose the following is a quick fix to avoid preparing descriptor
> for non-DMA operations (not tested anyhow)
>
> a/drivers/ata/sata_dwc_460ex.c
> +++ b/drivers/ata/sata_dwc_460ex.c
> @@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
> ata_queued_cmd *qc, u8 tag)
> __func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
> qc->n_elem);
>
> + if (!is_slave_direction(qc->dma_dir))
> + return;
> +
> desc = dma_dwc_xfer_setup(qc);
> if (!desc) {
> dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
I already have a better patch sitting here.
>> The real error is the lock recursion that's reported
>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>> With lock debugging enabled, I get the same error. This patch should
>> fix it.
>
>> - spin_lock_irqsave(&ap->host->lock, flags);
>> hsdevp->cmd_issued[tag] = cmd_issued;
>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>
>> +
>
> This will create a second empty line, though I don't care it is so minor.
The patch leaves one blank line before the following block comment. I
think it looks better that way.
--
M?ns Rullg?rd
On 12/19/2015 1:05 PM, M?ns Rullg?rd wrote:
> Andy Shevchenko <[email protected]> writes:
>
>> On Sat, Dec 19, 2015 at 5:40 PM, M?ns Rullg?rd <[email protected]> wrote:
>>
>>> OK, I've found something. The dma setup errors are benign, caused by
>>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>>> operations.
>> I suppose the following is a quick fix to avoid preparing descriptor
>> for non-DMA operations (not tested anyhow)
>>
>> a/drivers/ata/sata_dwc_460ex.c
>> +++ b/drivers/ata/sata_dwc_460ex.c
>> @@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
>> ata_queued_cmd *qc, u8 tag)
>> __func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
>> qc->n_elem);
>>
>> + if (!is_slave_direction(qc->dma_dir))
>> + return;
>> +
>> desc = dma_dwc_xfer_setup(qc);
>> if (!desc) {
>> dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
> I already have a better patch sitting here.
>
>>> The real error is the lock recursion that's reported
>>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>>> With lock debugging enabled, I get the same error. This patch should
>>> fix it.
>>> - spin_lock_irqsave(&ap->host->lock, flags);
>>> hsdevp->cmd_issued[tag] = cmd_issued;
>>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>>> +
>> This will create a second empty line, though I don't care it is so minor.
> The patch leaves one blank line before the following block comment. I
> think it looks better that way.
>
Still can't get the patch applied .
On Sat, Dec 19, 2015 at 7:09 PM, Julian Margetson <[email protected]> wrote:
> Still can't get the patch applied .
It might be faster if you just edit (remove 3 lines) directly in the file.
--
With Best Regards,
Andy Shevchenko
Julian Margetson <[email protected]> writes:
> On 12/19/2015 1:05 PM, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>> On Sat, Dec 19, 2015 at 5:40 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>
>>>> OK, I've found something. The dma setup errors are benign, caused by
>>>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>>>> operations.
>>> I suppose the following is a quick fix to avoid preparing descriptor
>>> for non-DMA operations (not tested anyhow)
>>>
>>> a/drivers/ata/sata_dwc_460ex.c
>>> +++ b/drivers/ata/sata_dwc_460ex.c
>>> @@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
>>> ata_queued_cmd *qc, u8 tag)
>>> __func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
>>> qc->n_elem);
>>>
>>> + if (!is_slave_direction(qc->dma_dir))
>>> + return;
>>> +
>>> desc = dma_dwc_xfer_setup(qc);
>>> if (!desc) {
>>> dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
>> I already have a better patch sitting here.
>>
>>>> The real error is the lock recursion that's reported
>>>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>>>> With lock debugging enabled, I get the same error. This patch should
>>>> fix it.
>>>> - spin_lock_irqsave(&ap->host->lock, flags);
>>>> hsdevp->cmd_issued[tag] = cmd_issued;
>>>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>>>> +
>>> This will create a second empty line, though I don't care it is so minor.
>> The patch leaves one blank line before the following block comment. I
>> think it looks better that way.
>>
>
> Still can't get the patch applied .
Sorry, didn't realise it conflicted with an intervening patch I had in
my tree. Try this one.
--
M?ns Rullg?rd
On 12/19/2015 1:19 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/19/2015 1:05 PM, M?ns Rullg?rd wrote:
>>> Andy Shevchenko <[email protected]> writes:
>>>
>>>> On Sat, Dec 19, 2015 at 5:40 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>>
>>>>> OK, I've found something. The dma setup errors are benign, caused by
>>>>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>>>>> operations.
>>>> I suppose the following is a quick fix to avoid preparing descriptor
>>>> for non-DMA operations (not tested anyhow)
>>>>
>>>> a/drivers/ata/sata_dwc_460ex.c
>>>> +++ b/drivers/ata/sata_dwc_460ex.c
>>>> @@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
>>>> ata_queued_cmd *qc, u8 tag)
>>>> __func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
>>>> qc->n_elem);
>>>>
>>>> + if (!is_slave_direction(qc->dma_dir))
>>>> + return;
>>>> +
>>>> desc = dma_dwc_xfer_setup(qc);
>>>> if (!desc) {
>>>> dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
>>> I already have a better patch sitting here.
>>>
>>>>> The real error is the lock recursion that's reported
>>>>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>>>>> With lock debugging enabled, I get the same error. This patch should
>>>>> fix it.
>>>>> - spin_lock_irqsave(&ap->host->lock, flags);
>>>>> hsdevp->cmd_issued[tag] = cmd_issued;
>>>>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>>>>> +
>>>> This will create a second empty line, though I don't care it is so minor.
>>> The patch leaves one blank line before the following block comment. I
>>> think it looks better that way.
>>>
>> Still can't get the patch applied .
> Sorry, didn't realise it conflicted with an intervening patch I had in
> my tree. Try this one.
>
Julian Margetson <[email protected]> writes:
> On 12/19/2015 1:19 PM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/19/2015 1:05 PM, M?ns Rullg?rd wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>> On Sat, Dec 19, 2015 at 5:40 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>>>
>>>>>> OK, I've found something. The dma setup errors are benign, caused by
>>>>>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>>>>>> operations.
>>>>> I suppose the following is a quick fix to avoid preparing descriptor
>>>>> for non-DMA operations (not tested anyhow)
>>>>>
>>>>> a/drivers/ata/sata_dwc_460ex.c
>>>>> +++ b/drivers/ata/sata_dwc_460ex.c
>>>>> @@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
>>>>> ata_queued_cmd *qc, u8 tag)
>>>>> __func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
>>>>> qc->n_elem);
>>>>>
>>>>> + if (!is_slave_direction(qc->dma_dir))
>>>>> + return;
>>>>> +
>>>>> desc = dma_dwc_xfer_setup(qc);
>>>>> if (!desc) {
>>>>> dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
>>>> I already have a better patch sitting here.
>>>>
>>>>>> The real error is the lock recursion that's reported
>>>>>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>>>>>> With lock debugging enabled, I get the same error. This patch should
>>>>>> fix it.
>>>>>> - spin_lock_irqsave(&ap->host->lock, flags);
>>>>>> hsdevp->cmd_issued[tag] = cmd_issued;
>>>>>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>>>>>> +
>>>>> This will create a second empty line, though I don't care it is so minor.
>>>> The patch leaves one blank line before the following block comment. I
>>>> think it looks better that way.
>>>>
>>> Still can't get the patch applied .
>> Sorry, didn't realise it conflicted with an intervening patch I had in
>> my tree. Try this one.
>>
>
>
> =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.12.19 14:44:52 =~=~=~=~=~=~=~=~=~=~=~=
>
> U-Boot 2015.a (May 16 2015 - 14:20:11)
>
> CPU: AMCC PowerPC 460EX Rev. B at 1155 MHz (PLB=231 OPB=115 EBC=115)
> No Security/Kasumi support
> Bootstrap Option H - Boot ROM Location I2C (Addr 0x52)
> Internal PCI arbiter enabled
> 32 kB I-Cache 32 kB D-Cache
> Board: Sam460ex/cr, PCIe 4x + SATA-2
> I2C: ready
> DRAM: 2 GiB (ECC not enabled, 462 MHz, CL4)
> PCI: Bus Dev VenId DevId Class Int
> 00 04 1095 3512 0104 00
> 00 06 126f 0501 0380 00
> PCIE1: successfully set as root-complex
> 02 00 1002 683f 0300 ff
> Net: ppc_4xx_eth0
> FPGA: Revision 03 (2010-10-07)
> SM502: found
> PERMD2:not found
> VGA: 1
> VESA: OK
> [ 0.000000] Using Canyonlands machine description
> [ 0.000000] Initializing cgroup subsys cpu
> [ 0.000000] Linux version 4.4.0-rc5-Sam460ex (root@julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #1 PREEMPT Sat Dec 19 14:25:55 AST 2015
> [ 0.000000] Zone ranges:
> [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
> [ 0.000000] Normal empty
> [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff]
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
> [ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752
> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200 console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
Please add ignore_log_level.
--
M?ns Rullg?rd
On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/19/2015 1:19 PM, M?ns Rullg?rd wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/19/2015 1:05 PM, M?ns Rullg?rd wrote:
>>>>> Andy Shevchenko <[email protected]> writes:
>>>>>
>>>>>> On Sat, Dec 19, 2015 at 5:40 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>>>>
>>>>>>> OK, I've found something. The dma setup errors are benign, caused by
>>>>>>> the driver calling dmaengine_prep_slave_sg() even for non-dma
>>>>>>> operations.
>>>>>> I suppose the following is a quick fix to avoid preparing descriptor
>>>>>> for non-DMA operations (not tested anyhow)
>>>>>>
>>>>>> a/drivers/ata/sata_dwc_460ex.c
>>>>>> +++ b/drivers/ata/sata_dwc_460ex.c
>>>>>> @@ -1041,6 +1041,9 @@ static void sata_dwc_qc_prep_by_tag(struct
>>>>>> ata_queued_cmd *qc, u8 tag)
>>>>>> __func__, ap->port_no, get_dma_dir_descript(qc->dma_dir),
>>>>>> qc->n_elem);
>>>>>>
>>>>>> + if (!is_slave_direction(qc->dma_dir))
>>>>>> + return;
>>>>>> +
>>>>>> desc = dma_dwc_xfer_setup(qc);
>>>>>> if (!desc) {
>>>>>> dev_err(ap->dev, "%s: dma_dwc_xfer_setup returns NULL\n",
>>>>> I already have a better patch sitting here.
>>>>>
>>>>>>> The real error is the lock recursion that's reported
>>>>>>> later. I wasn't seeing it since I was running a UP non-preempt kernel.
>>>>>>> With lock debugging enabled, I get the same error. This patch should
>>>>>>> fix it.
>>>>>>> - spin_lock_irqsave(&ap->host->lock, flags);
>>>>>>> hsdevp->cmd_issued[tag] = cmd_issued;
>>>>>>> - spin_unlock_irqrestore(&ap->host->lock, flags);
>>>>>>> +
>>>>>> This will create a second empty line, though I don't care it is so minor.
>>>>> The patch leaves one blank line before the following block comment. I
>>>>> think it looks better that way.
>>>>>
>>>> Still can't get the patch applied .
>>> Sorry, didn't realise it conflicted with an intervening patch I had in
>>> my tree. Try this one.
>>>
>>
>> =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.12.19 14:44:52 =~=~=~=~=~=~=~=~=~=~=~=
>>
>> U-Boot 2015.a (May 16 2015 - 14:20:11)
>>
>> CPU: AMCC PowerPC 460EX Rev. B at 1155 MHz (PLB=231 OPB=115 EBC=115)
>> No Security/Kasumi support
>> Bootstrap Option H - Boot ROM Location I2C (Addr 0x52)
>> Internal PCI arbiter enabled
>> 32 kB I-Cache 32 kB D-Cache
>> Board: Sam460ex/cr, PCIe 4x + SATA-2
>> I2C: ready
>> DRAM: 2 GiB (ECC not enabled, 462 MHz, CL4)
>> PCI: Bus Dev VenId DevId Class Int
>> 00 04 1095 3512 0104 00
>> 00 06 126f 0501 0380 00
>> PCIE1: successfully set as root-complex
>> 02 00 1002 683f 0300 ff
>> Net: ppc_4xx_eth0
>> FPGA: Revision 03 (2010-10-07)
>> SM502: found
>> PERMD2:not found
>> VGA: 1
>> VESA: OK
>> [ 0.000000] Using Canyonlands machine description
>> [ 0.000000] Initializing cgroup subsys cpu
>> [ 0.000000] Linux version 4.4.0-rc5-Sam460ex (root@julian-VirtualBox) (gcc version 4.8.2 (Ubuntu 4.8.2-16ubuntu3) ) #1 PREEMPT Sat Dec 19 14:25:55 AST 2015
>> [ 0.000000] Zone ranges:
>> [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff]
>> [ 0.000000] Normal empty
>> [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff]
>> [ 0.000000] Movable zone start for each node
>> [ 0.000000] Early memory node ranges
>> [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fffffff]
>> [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
>> [ 0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
>> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522752
>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200 console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
> Please add ignore_log_level.
>
Had to truncate the kernel command line to add it.
On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
> On 12/19/2015 3:07 PM, Måns Rullgård wrote:
>> Julian Margetson <[email protected]> writes:
>>> Total pages: 522752
>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>
>> Please add ignore_log_level.
>>
> Had to truncate the kernel command line to add it.
I guess Måns meant 'ignore_loglevel'
--
With Best Regards,
Andy Shevchenko
Andy Shevchenko <[email protected]> writes:
> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>> Julian Margetson <[email protected]> writes:
>
>>>> Total pages: 522752
>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>>
>>> Please add ignore_log_level.
>>>
>> Had to truncate the kernel command line to add it.
>
> I guess M?ns meant 'ignore_loglevel'
Obviously. I can never remember where the underscores go.
--
M?ns Rullg?rd
On 12/19/2015 4:41 PM, M?ns Rullg?rd wrote:
> Andy Shevchenko <[email protected]> writes:
>
>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>> Total pages: 522752
>>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>>> Please add ignore_log_level.
>>>>
>>> Had to truncate the kernel command line to add it.
>> I guess M?ns meant 'ignore_loglevel'
> Obviously. I can never remember where the underscores go.
>
:-)
On 12/19/2015 4:41 PM, M?ns Rullg?rd wrote:
> Andy Shevchenko <[email protected]> writes:
>
>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>> Total pages: 522752
>>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>>> Please add ignore_log_level.
>>>>
>>> Had to truncate the kernel command line to add it.
>> I guess M?ns meant 'ignore_loglevel'
> Obviously. I can never remember where the underscores go.
>
Julian Margetson <[email protected]> writes:
> On 12/19/2015 4:41 PM, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>> Total pages: 522752
>>>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>>>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>>>> Please add ignore_log_level.
>>>>>
>>>> Had to truncate the kernel command line to add it.
>>> I guess M?ns meant 'ignore_loglevel'
>> Obviously. I can never remember where the underscores go.
>
> [ 18.362244] sd 3:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
> [ 18.372454] sd 3:0:0:0: Attached scsi generic sg3 type 0
> [ 18.405433] sd 3:0:0:0: [sdc] Write Protect is off
> [ 18.420654] sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
> [ 18.461731] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
> [ 18.502918] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: port=0 dma dir=from device n_elem=1
> [ 18.511807] dma dma0chan0: dwc_prep_slave_sg
> [ 18.516083] dma dma0chan0: scanned 1 descriptors on freelist
> [ 18.521753] sata-dwc 4bffd1000.sata: dma_dwc_xfer_setup sg: 0xedeaa800, count: 1 addr: 0xfffffffff6a14400
> [ 18.531327] sata-dwc 4bffd1000.sata: sata_dwc_qc_issue: tag=0 ap->link.sactive = 0x00000001 sactive=0x00000001
> [ 18.541359] sata-dwc 4bffd1000.sata: sata_dwc_exec_command_by_tag cmd(0x60): READ FPDMA QUEUED tag=0
> [ 18.553703] sata-dwc 4bffd1000.sata: sata_dwc_isr intpr=0x00000082 active_tag=-84148995
> [ 18.561717] sata-dwc 4bffd1000.sata: sata_dwc_isr: NEWFP tag=0
> [ 18.567561] sata-dwc 4bffd1000.sata: sata_dwc_bmdma_start_by_tag qc=ed2340b8 tag: 0 cmd: 0x60 dma_dir: from device start_dma? 1
> [ 18.579043] sata-dwc 4bffd1000.sata: taskfile cmd: 0x60 protocol: ATA NCQ flags: 0x17 device: 40
> [ 18.587836] sata-dwc 4bffd1000.sata: feature: 0x08 nsect: 0x0 lbal: 0x0 lbam: 0x0 lbah: 0x0
> [ 18.596196] sata-dwc 4bffd1000.sata: hob_feature: 0x00 hob_nsect: 0x0 hob_lbal: 0x0 hob_lbam: 0x0 hob_lbah: 0x0
> [ 18.606292] dma dma0chan0: dwc_tx_submit: queued 2
> [ 18.611091] dma dma0chan0: dwc_dostart_first_queued: started 2
> [ 48.748614] ata3: lost interrupt (Status 0x40)
Now we're getting somewhere. The dma transfer is set up and initiated,
but then nothing happens. Comparing the old sata_dwc driver, from
before the switch to dmaengine, with the dw_dma driver, I noticed an
obvious problem: the descriptors are filled in using the wrong byte
order. This patch might fix that.
--
M?ns Rullg?rd
On Sun, Dec 20, 2015 at 7:11 PM, Måns Rullgård <[email protected]> wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/19/2015 4:41 PM, Måns Rullgård wrote:
>>> Andy Shevchenko <[email protected]> writes:
>>>
>>>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>>>> On 12/19/2015 3:07 PM, Måns Rullgård wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>> [ 18.606292] dma dma0chan0: dwc_tx_submit: queued 2
>> [ 18.611091] dma dma0chan0: dwc_dostart_first_queued: started 2
>> [ 48.748614] ata3: lost interrupt (Status 0x40)
>
> Now we're getting somewhere. The dma transfer is set up and initiated,
> but then nothing happens. Comparing the old sata_dwc driver, from
> before the switch to dmaengine, with the dw_dma driver, I noticed an
> obvious problem: the descriptors are filled in using the wrong byte
> order.
So, it means we have IO in little endian, but DMA reads data from
memory in big endian?
> This patch might fix that.
In case it works I have to test it on AVR32.
--
With Best Regards,
Andy Shevchenko
On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/19/2015 4:41 PM, M?ns Rullg?rd wrote:
>>> Andy Shevchenko <[email protected]> writes:
>>>
>>>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>>>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>> Total pages: 522752
>>>>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>>>>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>>>>> Please add ignore_log_level.
>>>>>>
>>>>> Had to truncate the kernel command line to add it.
>>>> I guess M?ns meant 'ignore_loglevel'
>>> Obviously. I can never remember where the underscores go.
>> [ 18.362244] sd 3:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
>> [ 18.372454] sd 3:0:0:0: Attached scsi generic sg3 type 0
>> [ 18.405433] sd 3:0:0:0: [sdc] Write Protect is off
>> [ 18.420654] sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
>> [ 18.461731] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
>> [ 18.502918] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: port=0 dma dir=from device n_elem=1
>> [ 18.511807] dma dma0chan0: dwc_prep_slave_sg
>> [ 18.516083] dma dma0chan0: scanned 1 descriptors on freelist
>> [ 18.521753] sata-dwc 4bffd1000.sata: dma_dwc_xfer_setup sg: 0xedeaa800, count: 1 addr: 0xfffffffff6a14400
>> [ 18.531327] sata-dwc 4bffd1000.sata: sata_dwc_qc_issue: tag=0 ap->link.sactive = 0x00000001 sactive=0x00000001
>> [ 18.541359] sata-dwc 4bffd1000.sata: sata_dwc_exec_command_by_tag cmd(0x60): READ FPDMA QUEUED tag=0
>> [ 18.553703] sata-dwc 4bffd1000.sata: sata_dwc_isr intpr=0x00000082 active_tag=-84148995
>> [ 18.561717] sata-dwc 4bffd1000.sata: sata_dwc_isr: NEWFP tag=0
>> [ 18.567561] sata-dwc 4bffd1000.sata: sata_dwc_bmdma_start_by_tag qc=ed2340b8 tag: 0 cmd: 0x60 dma_dir: from device start_dma? 1
>> [ 18.579043] sata-dwc 4bffd1000.sata: taskfile cmd: 0x60 protocol: ATA NCQ flags: 0x17 device: 40
>> [ 18.587836] sata-dwc 4bffd1000.sata: feature: 0x08 nsect: 0x0 lbal: 0x0 lbam: 0x0 lbah: 0x0
>> [ 18.596196] sata-dwc 4bffd1000.sata: hob_feature: 0x00 hob_nsect: 0x0 hob_lbal: 0x0 hob_lbam: 0x0 hob_lbah: 0x0
>> [ 18.606292] dma dma0chan0: dwc_tx_submit: queued 2
>> [ 18.611091] dma dma0chan0: dwc_dostart_first_queued: started 2
>> [ 48.748614] ata3: lost interrupt (Status 0x40)
> Now we're getting somewhere. The dma transfer is set up and initiated,
> but then nothing happens. Comparing the old sata_dwc driver, from
> before the switch to dmaengine, with the dw_dma driver, I noticed an
> obvious problem: the descriptors are filled in using the wrong byte
> order. This patch might fix that.
>
Andy Shevchenko <[email protected]> writes:
> On Sun, Dec 20, 2015 at 7:11 PM, M?ns Rullg?rd <[email protected]> wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/19/2015 4:41 PM, M?ns Rullg?rd wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>>>>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>
>>> [ 18.606292] dma dma0chan0: dwc_tx_submit: queued 2
>>> [ 18.611091] dma dma0chan0: dwc_dostart_first_queued: started 2
>>> [ 48.748614] ata3: lost interrupt (Status 0x40)
>>
>> Now we're getting somewhere. The dma transfer is set up and initiated,
>> but then nothing happens. Comparing the old sata_dwc driver, from
>> before the switch to dmaengine, with the dw_dma driver, I noticed an
>> obvious problem: the descriptors are filled in using the wrong byte
>> order.
>
> So, it means we have IO in little endian, but DMA reads data from
> memory in big endian?
No, it means the IO is little endian, and the DMA reads from memory in
little endian while the host CPU is big endian.
>> This patch might fix that.
>
> In case it works I have to test it on AVR32.
Unless I made a mistake, there should be no difference there. Still got
to test it of course.
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/19/2015 4:41 PM, M?ns Rullg?rd wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>> On Sat, Dec 19, 2015 at 10:16 PM, Julian Margetson <[email protected]> wrote:
>>>>>> On 12/19/2015 3:07 PM, M?ns Rullg?rd wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>>> Total pages: 522752
>>>>>>>> [ 0.000000] Kernel command line: root=/dev/sda8 console=ttyS0,115200
>>>>>>>> console=tty1 dw_dmac_core.dyndbg dw_dmac.dyndbg
>>>>>>> Please add ignore_log_level.
>>>>>>>
>>>>>> Had to truncate the kernel command line to add it.
>>>>> I guess M?ns meant 'ignore_loglevel'
>>>> Obviously. I can never remember where the underscores go.
>>> [ 18.362244] sd 3:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
>>> [ 18.372454] sd 3:0:0:0: Attached scsi generic sg3 type 0
>>> [ 18.405433] sd 3:0:0:0: [sdc] Write Protect is off
>>> [ 18.420654] sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
>>> [ 18.461731] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
>>> [ 18.502918] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: port=0 dma dir=from device n_elem=1
>>> [ 18.511807] dma dma0chan0: dwc_prep_slave_sg
>>> [ 18.516083] dma dma0chan0: scanned 1 descriptors on freelist
>>> [ 18.521753] sata-dwc 4bffd1000.sata: dma_dwc_xfer_setup sg: 0xedeaa800, count: 1 addr: 0xfffffffff6a14400
>>> [ 18.531327] sata-dwc 4bffd1000.sata: sata_dwc_qc_issue: tag=0 ap->link.sactive = 0x00000001 sactive=0x00000001
>>> [ 18.541359] sata-dwc 4bffd1000.sata: sata_dwc_exec_command_by_tag cmd(0x60): READ FPDMA QUEUED tag=0
>>> [ 18.553703] sata-dwc 4bffd1000.sata: sata_dwc_isr intpr=0x00000082 active_tag=-84148995
>>> [ 18.561717] sata-dwc 4bffd1000.sata: sata_dwc_isr: NEWFP tag=0
>>> [ 18.567561] sata-dwc 4bffd1000.sata: sata_dwc_bmdma_start_by_tag qc=ed2340b8 tag: 0 cmd: 0x60 dma_dir: from device start_dma? 1
>>> [ 18.579043] sata-dwc 4bffd1000.sata: taskfile cmd: 0x60 protocol: ATA NCQ flags: 0x17 device: 40
>>> [ 18.587836] sata-dwc 4bffd1000.sata: feature: 0x08 nsect: 0x0 lbal: 0x0 lbam: 0x0 lbah: 0x0
>>> [ 18.596196] sata-dwc 4bffd1000.sata: hob_feature: 0x00 hob_nsect: 0x0 hob_lbal: 0x0 hob_lbam: 0x0 hob_lbah: 0x0
>>> [ 18.606292] dma dma0chan0: dwc_tx_submit: queued 2
>>> [ 18.611091] dma dma0chan0: dwc_dostart_first_queued: started 2
>>> [ 48.748614] ata3: lost interrupt (Status 0x40)
>> Now we're getting somewhere. The dma transfer is set up and initiated,
>> but then nothing happens. Comparing the old sata_dwc driver, from
>> before the switch to dmaengine, with the dw_dma driver, I noticed an
>> obvious problem: the descriptors are filled in using the wrong byte
>> order. This patch might fix that.
>
> [ 18.534844] ata3.00: configured for UDMA/133
> [ 18.538182] scsi 3:0:0:0: Direct-Access ATA WDC WD5000AAKS-0 3B01 PQ: 0 ANSI: 5
> [ 18.539025] sd 3:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
> [ 18.539236] sd 3:0:0:0: [sdc] Write Protect is off
> [ 18.539245] sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
> [ 18.539338] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
> [ 18.540049] sd 3:0:0:0: Attached scsi generic sg3 type 0
> [ 18.540362] sata-dwc 4bffd1000.sata: sata_dwc_qc_prep_by_tag: port=0 dma dir=from device n_elem=1
> [ 18.540370] dma dma0chan0: dwc_prep_slave_sg
> [ 18.540378] dma dma0chan0: scanned 1 descriptors on freelist
> [ 18.540387] sata-dwc 4bffd1000.sata: dma_dwc_xfer_setup sg: 0xed37f200, count: 1 addr: 0xfffffffff6a18400
> [ 18.540395] sata-dwc 4bffd1000.sata: sata_dwc_qc_issue: tag=0 ap->link.sactive = 0x00000001 sactive=0x00000001
> [ 18.540426] sata-dwc 4bffd1000.sata: sata_dwc_exec_command_by_tag cmd(0x60): READ FPDMA QUEUED tag=0
> [ 18.556592] sata-dwc 4bffd1000.sata: sata_dwc_isr intpr=0x00000082 active_tag=-84148995
> [ 18.556599] sata-dwc 4bffd1000.sata: sata_dwc_isr: NEWFP tag=0
> [ 18.556609] sata-dwc 4bffd1000.sata: sata_dwc_bmdma_start_by_tag qc=ed2180b8 tag: 0 cmd: 0x60 dma_dir: from device start_dma? 1
> [ 18.556616] sata-dwc 4bffd1000.sata: taskfile cmd: 0x60 protocol: ATA NCQ flags: 0x17 device: 40
> [ 18.556623] sata-dwc 4bffd1000.sata: feature: 0x08 nsect: 0x0 lbal: 0x0 lbam: 0x0 lbah: 0x0
> [ 18.556631] sata-dwc 4bffd1000.sata: hob_feature: 0x00 hob_nsect: 0x0 hob_lbal: 0x0 hob_lbam: 0x0 hob_lbah: 0x0
> [ 18.556639] dma dma0chan0: dwc_tx_submit: queued 2
> [ 18.556646] dma dma0chan0: dwc_dostart_first_queued: started 2
> [ 48.748634] ata3: lost interrupt (Status 0x40)
> [ 48.753465] sata-dwc 4bffd1000.sata: sata_dwc_scr_read: id=3 reg=1 val=val=0x00000000
> [ 48.761369] ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x6 frozen
> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
Well, that didn't help. I still think it's part of the problem, but
something else must be wrong as well. The various Master Select fields
look like a good place to start. Also, the manual says the LLP_SRC_EN
and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
The old sata_dwc driver does this whereas dw_dma does not.
It might be worthwhile to try reverting drivers/ata/sata_dwc_460ex.c to
v4.0 (leaving the rest at 4.4-rc5) just to make sure that's a good
reference. I've verified that this builds.
--
M?ns Rullg?rd
On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]> wrote:
> Julian Margetson <[email protected]> writes:
>> On 12/20/2015 1:11 PM, Måns Rullgård wrote:
>>> Julian Margetson <[email protected]> writes:
>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>
> Well, that didn't help. I still think it's part of the problem, but
> something else must be wrong as well. The various Master Select fields
> look like a good place to start.
Master number (which is here would be either 1 or 0) should not affect
as long as they are connected to the same AHB bus (I would be
surprised if they are not).
> Also, the manual says the LLP_SRC_EN
> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
> The old sata_dwc driver does this whereas dw_dma does not.
Easy to fix, however I can't get how it might affect.
> It might be worthwhile to try reverting drivers/ata/sata_dwc_460ex.c to
> v4.0 (leaving the rest at 4.4-rc5) just to make sure that's a good
> reference. I've verified that this builds.
It would be nice.
I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
items on this board, however registers for SATA program it to 64. I
remember that I got no interrupt when I programmed transfer width
wrongly (64 bits against 32 bits) when I ported dw_dmac to be used on
Intel SoCs.
--
With Best Regards,
Andy Shevchenko
On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
<[email protected]> wrote:
> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]> wrote:
>> Julian Margetson <[email protected]> writes:
>>> On 12/20/2015 1:11 PM, Måns Rullgård wrote:
>>>> Julian Margetson <[email protected]> writes:
>
>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>
>> Well, that didn't help. I still think it's part of the problem, but
>> something else must be wrong as well. The various Master Select fields
>> look like a good place to start.
>
> Master number (which is here would be either 1 or 0) should not affect
> as long as they are connected to the same AHB bus (I would be
> surprised if they are not).
>
>> Also, the manual says the LLP_SRC_EN
>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>> The old sata_dwc driver does this whereas dw_dma does not.
>
> Easy to fix, however I can't get how it might affect.
>
>> It might be worthwhile to try reverting drivers/ata/sata_dwc_460ex.c to
>> v4.0 (leaving the rest at 4.4-rc5) just to make sure that's a good
>> reference. I've verified that this builds.
>
> It would be nice.
>
> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
> items on this board, however registers for SATA program it to 64. I
> remember that I got no interrupt when I programmed transfer width
> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used on
> Intel SoCs.
One more thing, I have a patch to monitor DMA IO, we may check what
exactly the values are written / read in DMA. I can share it
tomorrow.
P.S. I also noticed that original driver enables interrupt per each
block and sets protection control bits.
--
With Best Regards,
Andy Shevchenko
Andy Shevchenko <[email protected]> writes:
> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>> Julian Margetson <[email protected]> writes:
>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>> Julian Margetson <[email protected]> writes:
>
>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>
>> Well, that didn't help. I still think it's part of the problem, but
>> something else must be wrong as well. The various Master Select fields
>> look like a good place to start.
>
> Master number (which is here would be either 1 or 0) should not affect
> as long as they are connected to the same AHB bus (I would be
> surprised if they are not).
I think they are not. The relevant part of the block diagram for the
460EX looks something like this:
+-----+ +-----+ +-----+ +------+
| CPU |<==>| BUS |<==>| DMA |<==>| SATA |
+-----+ +-----+ +-----+ +------+
>> Also, the manual says the LLP_SRC_EN
>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>> The old sata_dwc driver does this whereas dw_dma does not.
>
> Easy to fix, however I can't get how it might affect.
>
>> It might be worthwhile to try reverting drivers/ata/sata_dwc_460ex.c to
>> v4.0 (leaving the rest at 4.4-rc5) just to make sure that's a good
>> reference. I've verified that this builds.
>
> It would be nice.
>
> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
> items on this board, however registers for SATA program it to 64. I
> remember that I got no interrupt when I programmed transfer width
> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used on
> Intel SoCs.
>
> --
> With Best Regards,
> Andy Shevchenko
--
M?ns Rullg?rd
M?ns Rullg?rd <[email protected]> writes:
> Andy Shevchenko <[email protected]> writes:
>
>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>>> Julian Margetson <[email protected]> writes:
>>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>
>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>
>>> Well, that didn't help. I still think it's part of the problem, but
>>> something else must be wrong as well. The various Master Select fields
>>> look like a good place to start.
>>
>> Master number (which is here would be either 1 or 0) should not affect
>> as long as they are connected to the same AHB bus (I would be
>> surprised if they are not).
>
> I think they are not. The relevant part of the block diagram for the
> 460EX looks something like this:
Oops, hit send by accident. More soon.
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>> Julian Margetson <[email protected]> writes:
>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>> Julian Margetson <[email protected]> writes:
>
>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>
>> Well, that didn't help. I still think it's part of the problem, but
>> something else must be wrong as well. The various Master Select fields
>> look like a good place to start.
>
> Master number (which is here would be either 1 or 0) should not affect
> as long as they are connected to the same AHB bus (I would be
> surprised if they are not).
I think they are not. The relevant part of the block diagram for the
460EX looks something like this:
+-----+
| CPU |
+-----+
|
+---------------+
| BUS |
+---------------+
| |
+-----+ +-----+
| DMA | | RAM |
+-----+ +-----+
|
+------+
| SATA |
+------+
The DMA-SATA link is private and ignores the address, which is the only
reason the driver can possibly work (it's programming a CPU virtual
address there).
>> Also, the manual says the LLP_SRC_EN
>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>> The old sata_dwc driver does this whereas dw_dma does not.
>
> Easy to fix, however I can't get how it might affect.
>From the Atmel doc:
In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
illegal, and causes indeterminate or erroneous behavior.
Most likely nothing happens, but I think it ought to be fixed. In fact,
I have a patch already.
Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
it off.
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
> <[email protected]> wrote:
>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>>> Julian Margetson <[email protected]> writes:
>>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>
>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>
>>> Well, that didn't help. I still think it's part of the problem, but
>>> something else must be wrong as well. The various Master Select fields
>>> look like a good place to start.
>>
>> Master number (which is here would be either 1 or 0) should not affect
>> as long as they are connected to the same AHB bus (I would be
>> surprised if they are not).
>>
>>> Also, the manual says the LLP_SRC_EN
>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>> The old sata_dwc driver does this whereas dw_dma does not.
>>
>> Easy to fix, however I can't get how it might affect.
>>
>>> It might be worthwhile to try reverting drivers/ata/sata_dwc_460ex.c to
>>> v4.0 (leaving the rest at 4.4-rc5) just to make sure that's a good
>>> reference. I've verified that this builds.
>>
>> It would be nice.
>>
>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>> items on this board, however registers for SATA program it to 64. I
>> remember that I got no interrupt when I programmed transfer width
>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used on
>> Intel SoCs.
>
> One more thing, I have a patch to monitor DMA IO, we may check what
> exactly the values are written / read in DMA. I can share it
> tomorrow.
>
> P.S. I also noticed that original driver enables interrupt per each
> block
And then ignores all but the transfer complete interrupt.
> and sets protection control bits.
With no indication what the value it sets is supposed to mean.
--
M?ns Rullg?rd
+Viresh
On Mon, Dec 21, 2015 at 2:58 AM, Måns Rullgård <[email protected]> wrote:
> Andy Shevchenko <[email protected]> writes:
>
>> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]> wrote:
>>> Julian Margetson <[email protected]> writes:
>>>> On 12/20/2015 1:11 PM, Måns Rullgård wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>
>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>
>>> Well, that didn't help. I still think it's part of the problem, but
>>> something else must be wrong as well. The various Master Select fields
>>> look like a good place to start.
>>
>> Master number (which is here would be either 1 or 0) should not affect
>> as long as they are connected to the same AHB bus (I would be
>> surprised if they are not).
>
> I think they are not. The relevant part of the block diagram for the
> 460EX looks something like this:
>
> +-----+
> | CPU |
> +-----+
> |
> +---------------+
> | BUS |
> +---------------+
> | |
> +-----+ +-----+
> | DMA | | RAM |
> +-----+ +-----+
> |
> +------+
> | SATA |
> +------+
>
> The DMA-SATA link is private and ignores the address, which is the only
> reason the driver can possibly work (it's programming a CPU virtual
> address there).
If you look at the original code the SMS and DMS are programmed
statically independent on DMA direction, so LLP is programmed always
to master 1. I don't think your scheme is reflecting this right. I
could imagine two AHB buses, one of them connects CPU, SATA and RAM,
and the other CPU and DMA.
In any case on all Intel SoCs and AVR32, and as far as I can tell on
Spear13xx (Viresh?) there is not a case, that's why I hardly imagine
that the problem is in master numbers by themselves.
>>> Also, the manual says the LLP_SRC_EN
>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>> The old sata_dwc driver does this whereas dw_dma does not.
>>
>> Easy to fix, however I can't get how it might affect.
>
> From the Atmel doc:
>
> In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
> CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
> illegal, and causes indeterminate or erroneous behavior.
I will check Synospys documentation later on.
> Most likely nothing happens, but I think it ought to be fixed. In fact,
> I have a patch already.
Good. Send with Fixes tag if it's upstream ready.
> Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
> it off.
I have ATNGW100.
P.S. Anyway we have to ask Julian to try the kernel with
8b3444852a2b58129 reverted.
--
With Best Regards,
Andy Shevchenko
Andy Shevchenko <[email protected]> writes:
> +Viresh
>
> On Mon, Dec 21, 2015 at 2:58 AM, M?ns Rullg?rd <[email protected]> wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>> Julian Margetson <[email protected]> writes:
>>>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>
>>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>>
>>>> Well, that didn't help. I still think it's part of the problem, but
>>>> something else must be wrong as well. The various Master Select fields
>>>> look like a good place to start.
>>>
>>> Master number (which is here would be either 1 or 0) should not affect
>>> as long as they are connected to the same AHB bus (I would be
>>> surprised if they are not).
>>
>> I think they are not. The relevant part of the block diagram for the
>> 460EX looks something like this:
>>
>> +-----+
>> | CPU |
>> +-----+
>> |
>> +---------------+
>> | BUS |
>> +---------------+
>> | |
>> +-----+ +-----+
>> | DMA | | RAM |
>> +-----+ +-----+
>> |
>> +------+
>> | SATA |
>> +------+
>>
>> The DMA-SATA link is private and ignores the address, which is the only
>> reason the driver can possibly work (it's programming a CPU virtual
>> address there).
>
> If you look at the original code the SMS and DMS are programmed
> statically independent on DMA direction, so LLP is programmed always
> to master 1. I don't think your scheme is reflecting this right. I
> could imagine two AHB buses, one of them connects CPU, SATA and RAM,
> and the other CPU and DMA.
Check the code again. The original code swaps SMS and DMS depending on
direction, and it sets LMS to 1. Put differently, it always sets the
memory side 1 and the device side to 0. The dw_dma driver sets SMS and
DMS to the src/dst_master values provided through dma_request_channel()
regardless of the current direction and LMS always zero. If those
values didn't matter, why would the fields exist in the first place?
> In any case on all Intel SoCs and AVR32, and as far as I can tell on
> Spear13xx (Viresh?) there is not a case, that's why I hardly imagine
> that the problem is in master numbers by themselves.
The 460EX is a PowerPC system. Expect unusual topologies.
>>>> Also, the manual says the LLP_SRC_EN
>>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>>> The old sata_dwc driver does this whereas dw_dma does not.
>>>
>>> Easy to fix, however I can't get how it might affect.
>>
>> From the Atmel doc:
>>
>> In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
>> CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
>> illegal, and causes indeterminate or erroneous behavior.
>
> I will check Synospys documentation later on.
>
>> Most likely nothing happens, but I think it ought to be fixed. In fact,
>> I have a patch already.
>
> Good. Send with Fixes tag if it's upstream ready.
>
>> Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
>> it off.
>
> I have ATNGW100.
I have an AT32ATK1006. Can you suggest a good test to exercise the DMA
engine?
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/21/2015 4:40 AM, Andy Shevchenko wrote:
>> +Viresh
>>
>> On Mon, Dec 21, 2015 at 2:58 AM, M?ns Rullg?rd <[email protected]> wrote:
>>> Andy Shevchenko <[email protected]> writes:
>>>
>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>>> Well, that didn't help. I still think it's part of the problem, but
>>>>> something else must be wrong as well. The various Master Select fields
>>>>> look like a good place to start.
>>>> Master number (which is here would be either 1 or 0) should not affect
>>>> as long as they are connected to the same AHB bus (I would be
>>>> surprised if they are not).
>>> I think they are not. The relevant part of the block diagram for the
>>> 460EX looks something like this:
>>>
>>> +-----+
>>> | CPU |
>>> +-----+
>>> |
>>> +---------------+
>>> | BUS |
>>> +---------------+
>>> | |
>>> +-----+ +-----+
>>> | DMA | | RAM |
>>> +-----+ +-----+
>>> |
>>> +------+
>>> | SATA |
>>> +------+
>>>
>>> The DMA-SATA link is private and ignores the address, which is the only
>>> reason the driver can possibly work (it's programming a CPU virtual
>>> address there).
>> If you look at the original code the SMS and DMS are programmed
>> statically independent on DMA direction, so LLP is programmed always
>> to master 1. I don't think your scheme is reflecting this right. I
>> could imagine two AHB buses, one of them connects CPU, SATA and RAM,
>> and the other CPU and DMA.
>>
>> In any case on all Intel SoCs and AVR32, and as far as I can tell on
>> Spear13xx (Viresh?) there is not a case, that's why I hardly imagine
>> that the problem is in master numbers by themselves.
>>
>>>>> Also, the manual says the LLP_SRC_EN
>>>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>>>> The old sata_dwc driver does this whereas dw_dma does not.
>>>> Easy to fix, however I can't get how it might affect.
>>> From the Atmel doc:
>>>
>>> In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
>>> CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
>>> illegal, and causes indeterminate or erroneous behavior.
>> I will check Synospys documentation later on.
>>
>>> Most likely nothing happens, but I think it ought to be fixed. In fact,
>>> I have a patch already.
>> Good. Send with Fixes tag if it's upstream ready.
>>
>>> Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
>>> it off.
>> I have ATNGW100.
>>
>> P.S. Anyway we have to ask Julian to try the kernel with
>> 8b3444852a2b58129 reverted.
>>
> git revert 8b3444852a2b58129
> error: could not revert 8b34448... sata_dwc_460ex: move to generic DMA driver
> hint: after resolving the conflicts, mark the corrected paths
> hint: with 'git add <paths>' or 'git rm <paths>'
> hint: and commit the result with 'git commit'
Yeah, that won't work since there are numerous changes afterward. Just
revert the entire file back to 4.0 like this:
$ git checkout v4.0 drivers/ata/sata_dwc_460ex.c
--
M?ns Rullg?rd
On 12/21/2015 8:16 AM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/21/2015 4:40 AM, Andy Shevchenko wrote:
>>> +Viresh
>>>
>>> On Mon, Dec 21, 2015 at 2:58 AM, M?ns Rullg?rd <[email protected]> wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>>>> Well, that didn't help. I still think it's part of the problem, but
>>>>>> something else must be wrong as well. The various Master Select fields
>>>>>> look like a good place to start.
>>>>> Master number (which is here would be either 1 or 0) should not affect
>>>>> as long as they are connected to the same AHB bus (I would be
>>>>> surprised if they are not).
>>>> I think they are not. The relevant part of the block diagram for the
>>>> 460EX looks something like this:
>>>>
>>>> +-----+
>>>> | CPU |
>>>> +-----+
>>>> |
>>>> +---------------+
>>>> | BUS |
>>>> +---------------+
>>>> | |
>>>> +-----+ +-----+
>>>> | DMA | | RAM |
>>>> +-----+ +-----+
>>>> |
>>>> +------+
>>>> | SATA |
>>>> +------+
>>>>
>>>> The DMA-SATA link is private and ignores the address, which is the only
>>>> reason the driver can possibly work (it's programming a CPU virtual
>>>> address there).
>>> If you look at the original code the SMS and DMS are programmed
>>> statically independent on DMA direction, so LLP is programmed always
>>> to master 1. I don't think your scheme is reflecting this right. I
>>> could imagine two AHB buses, one of them connects CPU, SATA and RAM,
>>> and the other CPU and DMA.
>>>
>>> In any case on all Intel SoCs and AVR32, and as far as I can tell on
>>> Spear13xx (Viresh?) there is not a case, that's why I hardly imagine
>>> that the problem is in master numbers by themselves.
>>>
>>>>>> Also, the manual says the LLP_SRC_EN
>>>>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>>>>> The old sata_dwc driver does this whereas dw_dma does not.
>>>>> Easy to fix, however I can't get how it might affect.
>>>> From the Atmel doc:
>>>>
>>>> In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
>>>> CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
>>>> illegal, and causes indeterminate or erroneous behavior.
>>> I will check Synospys documentation later on.
>>>
>>>> Most likely nothing happens, but I think it ought to be fixed. In fact,
>>>> I have a patch already.
>>> Good. Send with Fixes tag if it's upstream ready.
>>>
>>>> Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
>>>> it off.
>>> I have ATNGW100.
>>>
>>> P.S. Anyway we have to ask Julian to try the kernel with
>>> 8b3444852a2b58129 reverted.
>>>
>> git revert 8b3444852a2b58129
>> error: could not revert 8b34448... sata_dwc_460ex: move to generic DMA driver
>> hint: after resolving the conflicts, mark the corrected paths
>> hint: with 'git add <paths>' or 'git rm <paths>'
>> hint: and commit the result with 'git commit'
> Yeah, that won't work since there are numerous changes afterward. Just
> revert the entire file back to 4.0 like this:
>
> $ git checkout v4.0 drivers/ata/sata_dwc_460ex.c
>
CC [M] drivers/ata/sata_dwc_460ex.o
drivers/ata/sata_dwc_460ex.c:467:36: error: macro "dma_request_channel"
requires 3 arguments, but only 1 given
static int dma_request_channel(void)
^
drivers/ata/sata_dwc_460ex.c:468:1: error: expected ‘=’, ‘,’,
‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
drivers/ata/sata_dwc_460ex.c: In function ‘dma_dwc_xfer_setup’:
drivers/ata/sata_dwc_460ex.c:758:31: error: macro "dma_request_channel"
requires 3 arguments, but only 1 given
dma_ch = dma_request_channel();
^
drivers/ata/sata_dwc_460ex.c:758:11: error: ‘dma_request_channel’
undeclared (first use in this function)
dma_ch = dma_request_channel();
^
drivers/ata/sata_dwc_460ex.c:758:11: note: each undeclared identifier is
reported only once for each function it appears in
drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_dma_filter’:
drivers/ata/sata_dwc_460ex.c:1282:35: error: ‘struct
sata_dwc_device_port’ has no member named ‘dws’
struct dw_dma_slave *dws = hsdevp->dws;
^
drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_port_start’:
drivers/ata/sata_dwc_460ex.c:1325:17: warning: unused variable
‘mask’ [-Wunused-variable]
dma_cap_mask_t mask;
^
drivers/ata/sata_dwc_460ex.c: At top level:
drivers/ata/sata_dwc_460ex.c:345:28: warning: ‘sata_dwc_dma_dws’
defined but not used [-Wunused-variable]
static struct dw_dma_slave sata_dwc_dma_dws = {
^
drivers/ata/sata_dwc_460ex.c:1279:13: warning: ‘sata_dwc_dma_filter’
defined but not used [-Wunused-function]
static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
^
make[2]: *** [drivers/ata/sata_dwc_460ex.o] Error 1
make[1]: *** [drivers/ata] Error 2
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
Julian Margetson <[email protected]> writes:
>>>> P.S. Anyway we have to ask Julian to try the kernel with
>>>> 8b3444852a2b58129 reverted.
>>>>
>>> git revert 8b3444852a2b58129
>>> error: could not revert 8b34448... sata_dwc_460ex: move to generic DMA driver
>>> hint: after resolving the conflicts, mark the corrected paths
>>> hint: with 'git add <paths>' or 'git rm <paths>'
>>> hint: and commit the result with 'git commit'
>> Yeah, that won't work since there are numerous changes afterward. Just
>> revert the entire file back to 4.0 like this:
>>
>> $ git checkout v4.0 drivers/ata/sata_dwc_460ex.c
>>
> CC [M] drivers/ata/sata_dwc_460ex.o
> drivers/ata/sata_dwc_460ex.c:467:36: error: macro
> "dma_request_channel" requires 3 arguments, but only 1 given
> static int dma_request_channel(void)
> ^
> drivers/ata/sata_dwc_460ex.c:468:1: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
> {
> ^
> drivers/ata/sata_dwc_460ex.c: In function ‘dma_dwc_xfer_setup’:
> drivers/ata/sata_dwc_460ex.c:758:31: error: macro
> "dma_request_channel" requires 3 arguments, but only 1 given
> dma_ch = dma_request_channel();
> ^
> drivers/ata/sata_dwc_460ex.c:758:11: error: ‘dma_request_channel’
> undeclared (first use in this function)
> dma_ch = dma_request_channel();
> ^
> drivers/ata/sata_dwc_460ex.c:758:11: note: each undeclared identifier
> is reported only once for each function it appears in
> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_dma_filter’:
> drivers/ata/sata_dwc_460ex.c:1282:35: error: ‘struct
> sata_dwc_device_port’ has no member named ‘dws’
> struct dw_dma_slave *dws = hsdevp->dws;
> ^
> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_port_start’:
> drivers/ata/sata_dwc_460ex.c:1325:17: warning: unused variable
> ‘mask’ [-Wunused-variable]
> dma_cap_mask_t mask;
> ^
> drivers/ata/sata_dwc_460ex.c: At top level:
> drivers/ata/sata_dwc_460ex.c:345:28: warning: ‘sata_dwc_dma_dws’
> defined but not used [-Wunused-variable]
> static struct dw_dma_slave sata_dwc_dma_dws = {
> ^
> drivers/ata/sata_dwc_460ex.c:1279:13: warning:
> ‘sata_dwc_dma_filter’ defined but not used [-Wunused-function]
> static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
> ^
Those messages do not match the contents of the file from v4.0.
For your convenience, here's the file as it should be.
$ sha1sum drivers/ata/sata_dwc_460ex.c
0f54dfa3a91591101f5de434c3a631a5cd20ff1a drivers/ata/sata_dwc_460ex.c
--
Måns Rullgård
On 12/21/2015 9:24 AM, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
>>>>> P.S. Anyway we have to ask Julian to try the kernel with
>>>>> 8b3444852a2b58129 reverted.
>>>>>
>>>> git revert 8b3444852a2b58129
>>>> error: could not revert 8b34448... sata_dwc_460ex: move to generic DMA driver
>>>> hint: after resolving the conflicts, mark the corrected paths
>>>> hint: with 'git add <paths>' or 'git rm <paths>'
>>>> hint: and commit the result with 'git commit'
>>> Yeah, that won't work since there are numerous changes afterward. Just
>>> revert the entire file back to 4.0 like this:
>>>
>>> $ git checkout v4.0 drivers/ata/sata_dwc_460ex.c
>>>
>> CC [M] drivers/ata/sata_dwc_460ex.o
>> drivers/ata/sata_dwc_460ex.c:467:36: error: macro
>> "dma_request_channel" requires 3 arguments, but only 1 given
>> static int dma_request_channel(void)
>> ^
>> drivers/ata/sata_dwc_460ex.c:468:1: error: expected ‘=’, ‘,’,
>> ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
>> {
>> ^
>> drivers/ata/sata_dwc_460ex.c: In function ‘dma_dwc_xfer_setup’:
>> drivers/ata/sata_dwc_460ex.c:758:31: error: macro
>> "dma_request_channel" requires 3 arguments, but only 1 given
>> dma_ch = dma_request_channel();
>> ^
>> drivers/ata/sata_dwc_460ex.c:758:11: error: ‘dma_request_channel’
>> undeclared (first use in this function)
>> dma_ch = dma_request_channel();
>> ^
>> drivers/ata/sata_dwc_460ex.c:758:11: note: each undeclared identifier
>> is reported only once for each function it appears in
>> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_dma_filter’:
>> drivers/ata/sata_dwc_460ex.c:1282:35: error: ‘struct
>> sata_dwc_device_port’ has no member named ‘dws’
>> struct dw_dma_slave *dws = hsdevp->dws;
>> ^
>> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_port_start’:
>> drivers/ata/sata_dwc_460ex.c:1325:17: warning: unused variable
>> ‘mask’ [-Wunused-variable]
>> dma_cap_mask_t mask;
>> ^
>> drivers/ata/sata_dwc_460ex.c: At top level:
>> drivers/ata/sata_dwc_460ex.c:345:28: warning: ‘sata_dwc_dma_dws’
>> defined but not used [-Wunused-variable]
>> static struct dw_dma_slave sata_dwc_dma_dws = {
>> ^
>> drivers/ata/sata_dwc_460ex.c:1279:13: warning:
>> ‘sata_dwc_dma_filter’ defined but not used [-Wunused-function]
>> static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
>> ^
> Those messages do not match the contents of the file from v4.0.
> For your convenience, here's the file as it should be.
>
> $ sha1sum drivers/ata/sata_dwc_460ex.c
> 0f54dfa3a91591101f5de434c3a631a5cd20ff1a drivers/ata/sata_dwc_460ex.c
>
Julian Margetson <[email protected]> writes:
> On 12/21/2015 9:24 AM, Måns Rullgård wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>>>>> P.S. Anyway we have to ask Julian to try the kernel with
>>>>>> 8b3444852a2b58129 reverted.
>>>>>>
>>>>> git revert 8b3444852a2b58129
>>>>> error: could not revert 8b34448... sata_dwc_460ex: move to generic DMA driver
>>>>> hint: after resolving the conflicts, mark the corrected paths
>>>>> hint: with 'git add <paths>' or 'git rm <paths>'
>>>>> hint: and commit the result with 'git commit'
>>>> Yeah, that won't work since there are numerous changes afterward. Just
>>>> revert the entire file back to 4.0 like this:
>>>>
>>>> $ git checkout v4.0 drivers/ata/sata_dwc_460ex.c
>>>>
>>> CC [M] drivers/ata/sata_dwc_460ex.o
>>> drivers/ata/sata_dwc_460ex.c:467:36: error: macro
>>> "dma_request_channel" requires 3 arguments, but only 1 given
>>> static int dma_request_channel(void)
>>> ^
>>> drivers/ata/sata_dwc_460ex.c:468:1: error: expected ‘=’, ‘,’,
>>> ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
>>> {
>>> ^
>>> drivers/ata/sata_dwc_460ex.c: In function ‘dma_dwc_xfer_setup’:
>>> drivers/ata/sata_dwc_460ex.c:758:31: error: macro
>>> "dma_request_channel" requires 3 arguments, but only 1 given
>>> dma_ch = dma_request_channel();
>>> ^
>>> drivers/ata/sata_dwc_460ex.c:758:11: error: ‘dma_request_channel’
>>> undeclared (first use in this function)
>>> dma_ch = dma_request_channel();
>>> ^
>>> drivers/ata/sata_dwc_460ex.c:758:11: note: each undeclared identifier
>>> is reported only once for each function it appears in
>>> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_dma_filter’:
>>> drivers/ata/sata_dwc_460ex.c:1282:35: error: ‘struct
>>> sata_dwc_device_port’ has no member named ‘dws’
>>> struct dw_dma_slave *dws = hsdevp->dws;
>>> ^
>>> drivers/ata/sata_dwc_460ex.c: In function ‘sata_dwc_port_start’:
>>> drivers/ata/sata_dwc_460ex.c:1325:17: warning: unused variable
>>> ‘mask’ [-Wunused-variable]
>>> dma_cap_mask_t mask;
>>> ^
>>> drivers/ata/sata_dwc_460ex.c: At top level:
>>> drivers/ata/sata_dwc_460ex.c:345:28: warning: ‘sata_dwc_dma_dws’
>>> defined but not used [-Wunused-variable]
>>> static struct dw_dma_slave sata_dwc_dma_dws = {
>>> ^
>>> drivers/ata/sata_dwc_460ex.c:1279:13: warning:
>>> ‘sata_dwc_dma_filter’ defined but not used [-Wunused-function]
>>> static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
>>> ^
>> Those messages do not match the contents of the file from v4.0.
>> For your convenience, here's the file as it should be.
>>
>> $ sha1sum drivers/ata/sata_dwc_460ex.c
>> 0f54dfa3a91591101f5de434c3a631a5cd20ff1a drivers/ata/sata_dwc_460ex.c
>
> [ 16.119186] BUG: spinlock recursion on CPU#0, kworker/u2:1/85
> [ 16.124935] lock: 0xedd2f910, .magic: dead4ead, .owner: kworker/u2:1/85, .owner_cpu: 0
> [ 16.132947] CPU: 0 PID: 85 Comm: kworker/u2:1 Not tainted 4.4.0-rc5-Sam460ex-dirty #3
> [ 16.140793] Workqueue: events_unbound async_run_entry_fn
> [ 16.146119] Call Trace:
> [ 16.148582] [ee3cf8c0] [c0049238] do_raw_spin_lock+0x4c/0x100 (unreliable)
> [ 16.155491] [ee3cf8e0] [c068af98] _raw_spin_lock_irqsave+0x2c/0x38
> [ 16.161721] [ee3cf8f0] [f6a0fd98] sata_dwc_exec_command_by_tag.constprop.9+0x80/0xb4 [sata_dwc_460ex]
> [ 16.170954] [ee3cf920] [f6a108c0] sata_dwc_qc_issue+0x6a4/0x6c4 [sata_dwc_460ex]
> [ 16.178380] [ee3cf9d0] [c043bdf8] ata_qc_issue+0x338/0x3a0
> [ 16.183883] [ee3cfa00] [c0440c84] ata_scsi_translate+0xf4/0x150
> [ 16.189813] [ee3cfa20] [c0444080] ata_scsi_queuecmd+0x1e8/0x238
> [ 16.195750] [ee3cfa40] [c042511c] scsi_dispatch_cmd+0xd4/0x110
> [ 16.201602] [ee3cfa50] [c0427a9c] scsi_request_fn+0x52c/0x55c
Oh, that one again. My patch still applies. Here it is as applied to
that revision of the file.
>From what I can tell, that bug has always been there. Probably nobody
ever tested the driver in a PREEMPT or SMP build, nor with lock
debugging enabled.
--
Måns Rullgård
On Mon, 2015-12-21 at 15:24 +0000, Måns Rullgård wrote:
> Julian Margetson <[email protected]> writes:
>
>
> Oh, that one again. My patch still applies. Here it is as applied
> to
> that revision of the file.
>
> From what I can tell, that bug has always been there. Probably
> nobody
> ever tested the driver in a PREEMPT or SMP build, nor with lock
> debugging enabled.
I guess it's a time to submit this one to upstream with proper Fixes:
tag (which I suppose the initial commit of the driver).
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
> <[email protected]> wrote:
> > On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]>
> > wrote:
> > I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
> > items on this board, however registers for SATA program it to 64. I
> > remember that I got no interrupt when I programmed transfer width
> > wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
> > on
> > Intel SoCs.
>
> One more thing, I have a patch to monitor DMA IO, we may check what
> exactly the values are written / read in DMA. I can share it
> tomorrow.
As promised the patch I have to debug IO of DW DMA. Didn't check though
if it applies cleanly on top of recent vanilla kernel.
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>> <[email protected]> wrote:
>>> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]>
>>> wrote:
>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>> items on this board, however registers for SATA program it to 64. I
>>> remember that I got no interrupt when I programmed transfer width
>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>> on
>>> Intel SoCs.
>> One more thing, I have a patch to monitor DMA IO, we may check what
>> exactly the values are written / read in DMA. I can share it
>> tomorrow.
> As promised the patch I have to debug IO of DW DMA. Didn't check though
> if it applies cleanly on top of recent vanilla kernel.
>
patch -p1 -R <../0001-dw_dmac-debug-dma-controller-IO.patch
patching file drivers/dma/dw/core.c
Hunk #1 succeeded at 543 (offset -27 lines).
Hunk #2 FAILED at 1571.
Hunk #3 FAILED at 1717.
2 out of 3 hunks FAILED -- saving rejects to file drivers/dma/dw/core.c.rej
patching file drivers/dma/dw/regs.h
Hunk #1 succeeded at 114 (offset -16 lines).
Hunk #2 succeeded at 262 (offset -39 lines).
Hunk #3 succeeded at 293 (offset -40 lines).
root@julian-VirtualBox:/usr/src/linux-test# patch -p1
<../0001-dw_dmac-debug-dma-controller-IO.patch
patching file drivers/dma/dw/core.c
Hunk #1 succeeded at 543 (offset -27 lines).
Hunk #2 FAILED at 1572.
Hunk #3 FAILED at 1716.
2 out of 3 hunks FAILED -- saving rejects to file drivers/dma/dw/core.c.rej
patching file drivers/dma/dw/regs.h
Hunk #1 succeeded at 114 (offset -16 lines).
Hunk #2 succeeded at 264 (offset -39 lines).
Hunk #3 succeeded at 307 (offset -40 lines).
On Mon, Dec 21, 2015 at 2:15 PM, Måns Rullgård <[email protected]> wrote:
> Andy Shevchenko <[email protected]> writes:
>
>> +Viresh
>>
>> On Mon, Dec 21, 2015 at 2:58 AM, Måns Rullgård <[email protected]> wrote:
>>> Andy Shevchenko <[email protected]> writes:
>>>
>>>> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]> wrote:
>>>>> Julian Margetson <[email protected]> writes:
>>>>>> On 12/20/2015 1:11 PM, Måns Rullgård wrote:
>>>>>>> Julian Margetson <[email protected]> writes:
>>>>
>>>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>>>
>>>>> Well, that didn't help. I still think it's part of the problem, but
>>>>> something else must be wrong as well. The various Master Select fields
>>>>> look like a good place to start.
>>>>
>>>> Master number (which is here would be either 1 or 0) should not affect
>>>> as long as they are connected to the same AHB bus (I would be
>>>> surprised if they are not).
>>>
>>> I think they are not. The relevant part of the block diagram for the
>>> 460EX looks something like this:
>>>
>>> +-----+
>>> | CPU |
>>> +-----+
>>> |
>>> +---------------+
>>> | BUS |
>>> +---------------+
>>> | |
>>> +-----+ +-----+
>>> | DMA | | RAM |
>>> +-----+ +-----+
>>> |
>>> +------+
>>> | SATA |
>>> +------+
>>>
>>> The DMA-SATA link is private and ignores the address, which is the only
>>> reason the driver can possibly work (it's programming a CPU virtual
>>> address there).
>>
>> If you look at the original code the SMS and DMS are programmed
>> statically independent on DMA direction, so LLP is programmed always
>> to master 1. I don't think your scheme is reflecting this right. I
>> could imagine two AHB buses, one of them connects CPU, SATA and RAM,
>> and the other CPU and DMA.
>
> Check the code again. The original code swaps SMS and DMS depending on
> direction, and it sets LMS to 1. Put differently, it always sets the
> memory side 1 and the device side to 0. The dw_dma driver sets SMS and
> DMS to the src/dst_master values provided through dma_request_channel()
> regardless of the current direction and LMS always zero.
I used to have a patch to implement this in dw_dmac driver. However, I
dropped it at some point. Seems we need it back and now I possible
have a good explanation why.
> If those
> values didn't matter, why would the fields exist in the first place?
Because someone can have more than one AHB bus on the system and
connect DMA to all of them (up to 4).
>> In any case on all Intel SoCs and AVR32, and as far as I can tell on
>> Spear13xx (Viresh?) there is not a case, that's why I hardly imagine
>> that the problem is in master numbers by themselves.
>
> The 460EX is a PowerPC system. Expect unusual topologies.
Yeah, that's right.
>>>>> Also, the manual says the LLP_SRC_EN
>>>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>>>> The old sata_dwc driver does this whereas dw_dma does not.
>>>>
>>>> Easy to fix, however I can't get how it might affect.
>>>
>>> From the Atmel doc:
>>>
>>> In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
>>> CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
>>> illegal, and causes indeterminate or erroneous behavior.
>>
>> I will check Synospys documentation later on.
Yes, we have to clear those bits. I will do a patch or you already have one?
>>> Most likely nothing happens, but I think it ought to be fixed. In fact,
>>> I have a patch already.
>>
>> Good. Send with Fixes tag if it's upstream ready.
>>
>>> Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
>>> it off.
>>
>> I have ATNGW100.
>
> I have an AT32ATK1006. Can you suggest a good test to exercise the DMA
> engine?
On that board I tried MMC (the only available user for me), though it
is not reliable, I also tried the dmatest module.
--
With Best Regards,
Andy Shevchenko
On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>> <[email protected]> wrote:
>>> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]>
>>> wrote:
>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>> items on this board, however registers for SATA program it to 64. I
>>> remember that I got no interrupt when I programmed transfer width
>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>> on
>>> Intel SoCs.
>> One more thing, I have a patch to monitor DMA IO, we may check what
>> exactly the values are written / read in DMA. I can share it
>> tomorrow.
> As promised the patch I have to debug IO of DW DMA. Didn't check though
> if it applies cleanly on top of recent vanilla kernel.
>
On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>
>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>
>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>> <[email protected]> wrote:
>>>>
>>>> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]>
>>>> wrote:
>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>> items on this board, however registers for SATA program it to 64. I
>>>> remember that I got no interrupt when I programmed transfer width
>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>> on
>>>> Intel SoCs.
>>>
>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>> exactly the values are written / read in DMA. I can share it
>>> tomorrow.
>>
>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>> if it applies cleanly on top of recent vanilla kernel.
So, the original driver (with patch from Måns) works, right?
--
With Best Regards,
Andy Shevchenko
Andy Shevchenko <[email protected]> writes:
> On Mon, Dec 21, 2015 at 2:15 PM, M?ns Rullg?rd <[email protected]> wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>> +Viresh
>>>
>>> On Mon, Dec 21, 2015 at 2:58 AM, M?ns Rullg?rd <[email protected]> wrote:
>>>> Andy Shevchenko <[email protected]> writes:
>>>>
>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]> wrote:
>>>>>> Julian Margetson <[email protected]> writes:
>>>>>>> On 12/20/2015 1:11 PM, M?ns Rullg?rd wrote:
>>>>>>>> Julian Margetson <[email protected]> writes:
>>>>>
>>>>>>> [ 48.769671] ata3.00: failed command: READ FPDMA QUEUED
>>>>>>
>>>>>> Well, that didn't help. I still think it's part of the problem, but
>>>>>> something else must be wrong as well. The various Master Select fields
>>>>>> look like a good place to start.
>>>>>
>>>>> Master number (which is here would be either 1 or 0) should not affect
>>>>> as long as they are connected to the same AHB bus (I would be
>>>>> surprised if they are not).
>>>>
>>>> I think they are not. The relevant part of the block diagram for the
>>>> 460EX looks something like this:
>>>>
>>>> +-----+
>>>> | CPU |
>>>> +-----+
>>>> |
>>>> +---------------+
>>>> | BUS |
>>>> +---------------+
>>>> | |
>>>> +-----+ +-----+
>>>> | DMA | | RAM |
>>>> +-----+ +-----+
>>>> |
>>>> +------+
>>>> | SATA |
>>>> +------+
>>>>
>>>> The DMA-SATA link is private and ignores the address, which is the only
>>>> reason the driver can possibly work (it's programming a CPU virtual
>>>> address there).
>>>
>>> If you look at the original code the SMS and DMS are programmed
>>> statically independent on DMA direction, so LLP is programmed always
>>> to master 1. I don't think your scheme is reflecting this right. I
>>> could imagine two AHB buses, one of them connects CPU, SATA and RAM,
>>> and the other CPU and DMA.
>>
>> Check the code again. The original code swaps SMS and DMS depending on
>> direction, and it sets LMS to 1. Put differently, it always sets the
>> memory side 1 and the device side to 0. The dw_dma driver sets SMS and
>> DMS to the src/dst_master values provided through dma_request_channel()
>> regardless of the current direction and LMS always zero.
>
> I used to have a patch to implement this in dw_dmac driver. However, I
> dropped it at some point. Seems we need it back and now I possible
> have a good explanation why.
Are you still able to find that patch? Shouldn't be too hard to do from
scratch if not.
>> If those values didn't matter, why would the fields exist in the
>> first place?
>
> Because someone can have more than one AHB bus on the system and
> connect DMA to all of them (up to 4).
Which apparently these guys did. Well, not a full-blown AHB bus, but
they seem to be using two master interfaces.
>>> In any case on all Intel SoCs and AVR32, and as far as I can tell on
>>> Spear13xx (Viresh?) there is not a case, that's why I hardly imagine
>>> that the problem is in master numbers by themselves.
>>
>> The 460EX is a PowerPC system. Expect unusual topologies.
>
> Yeah, that's right.
BTW, there's a good reason for wiring it like this. If the source and
destination are on different buses, the DMA engine can do a read and a
write in each cycle. Otherwise the reads and writes have to be issued
alternately.
>>>>>> Also, the manual says the LLP_SRC_EN
>>>>>> and LLP_DST_EN flags should be cleared on the last in a chain of blocks.
>>>>>> The old sata_dwc driver does this whereas dw_dma does not.
>>>>>
>>>>> Easy to fix, however I can't get how it might affect.
>>>>
>>>> From the Atmel doc:
>>>>
>>>> In Table 17-1 on page 185, all other combinations of LLPx.LOC = 0,
>>>> CTLx.LLP_S_EN, CFGx.RELOAD_SR, CTLx.LLP_D_EN, and CFGx.RELOAD_DS are
>>>> illegal, and causes indeterminate or erroneous behavior.
>>>
>>> I will check Synospys documentation later on.
>
> Yes, we have to clear those bits. I will do a patch or you already have one?
I'll send the patch soon.
>>>> Most likely nothing happens, but I think it ought to be fixed. In fact,
>>>> I have a patch already.
>>>
>>> Good. Send with Fixes tag if it's upstream ready.
>>>
>>>> Come to think of it, I have an AVR32 dev somewhere. Maybe I should dust
>>>> it off.
>>>
>>> I have ATNGW100.
>>
>> I have an AT32ATK1006. Can you suggest a good test to exercise the DMA
>> engine?
>
> On that board I tried MMC (the only available user for me), though it
> is not reliable, I also tried the dmatest module.
Hmm, is there anywhere this damn driver actually works? ;-)
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
> On Mon, 2015-12-21 at 15:24 +0000, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>
>> Oh, that one again.??My patch still applies.??Here it is as applied
>> to
>> that revision of the file.
>>
>> From what I can tell, that bug has always been there.??Probably
>> nobody
>> ever tested the driver in a PREEMPT or SMP build, nor with lock
>> debugging enabled.
>
> I guess it's a time to submit this one to upstream with proper Fixes:
> tag (which I suppose the initial commit of the driver).
Done.
--
M?ns Rullg?rd
On 12/21/2015 1:55 PM, Andy Shevchenko wrote:
> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>> <[email protected]> wrote:
>>>>> On Sun, Dec 20, 2015 at 8:49 PM, Måns Rullgård <[email protected]>
>>>>> wrote:
>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>> items on this board, however registers for SATA program it to 64. I
>>>>> remember that I got no interrupt when I programmed transfer width
>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>> on
>>>>> Intel SoCs.
>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>> exactly the values are written / read in DMA. I can share it
>>>> tomorrow.
>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>> if it applies cleanly on top of recent vanilla kernel.
> So, the original driver (with patch from Måns) works, right?
>
The hard drive is recognized .
These system gets unresponsive with USB devices like the mouse and
keyboard not responding when I start Gparted.
Andy Shevchenko <[email protected]> writes:
> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>>
>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>>
>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>> <[email protected]> wrote:
>>>>>
>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]>
>>>>> wrote:
>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>> items on this board, however registers for SATA program it to 64. I
>>>>> remember that I got no interrupt when I programmed transfer width
>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>> on
>>>>> Intel SoCs.
>>>>
>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>> exactly the values are written / read in DMA. I can share it
>>>> tomorrow.
>>>
>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>> if it applies cleanly on top of recent vanilla kernel.
>
> So, the original driver (with patch from M?ns) works, right?
Looks that way to me. At least it's able to read the partition table.
What happens after that is hard to tell, but I don't see any obvious
errors.
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/21/2015 1:55 PM, Andy Shevchenko wrote:
>> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>>> <[email protected]> wrote:
>>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]>
>>>>>> wrote:
>>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>>> items on this board, however registers for SATA program it to 64. I
>>>>>> remember that I got no interrupt when I programmed transfer width
>>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>>> on
>>>>>> Intel SoCs.
>>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>>> exactly the values are written / read in DMA. I can share it
>>>>> tomorrow.
>>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>>> if it applies cleanly on top of recent vanilla kernel.
>> So, the original driver (with patch from M?ns) works, right?
>>
> The hard drive is recognized .
> These system gets unresponsive with USB devices like the mouse and
> keyboard not responding when I start Gparted.
Did you disable the SATA and DMA debug messages?
--
M?ns Rullg?rd
On Mon, 2015-12-21 at 01:19 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > P.S. I also noticed that original driver enables interrupt per each
> > block
>
> And then ignores all but the transfer complete interrupt.
>
> > and sets protection control bits.
>
> With no indication what the value it sets is supposed to mean.
Okay, let's summarize what we have:
0. AR: Get a working reference for PPC 460EX SATA driver
1. AR: Clear LLP_EN bits at the last block of LLP transfer
2. AR: Rename masters to 'memory' and 'peripheral' and change them per
DMA direction
3. AR: Set LMS (LLP master) to 'memory' when do LLP transfers
4. CHECK: PROTCTL bit (documentation says that recommended value is
0x01)
5. CHECK: Other bits in CFG register (FIFO_MODE, FCMODE)
6. CHECK: Block interrupts vs. one interrupt at the end of block chain
(Måns, I missed how any of them is ignored)
7. AR: Test everything on Intel SoCs such as Baytrail, CherryTrail, etc
(SPI, UART, dmatest), AVR32 (MMC, dmatest), PPC 460EX (Onboard SATA)
I can share my working branch with a set of patches regarding to
dw_dmac. We may do our work based on that code and after I'll submit
everything to upstream. Does it sound okay for you, guys?
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On 12/21/2015 2:27 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/21/2015 1:55 PM, Andy Shevchenko wrote:
>>> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>>>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>>>> <[email protected]> wrote:
>>>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]>
>>>>>>> wrote:
>>>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>>>> items on this board, however registers for SATA program it to 64. I
>>>>>>> remember that I got no interrupt when I programmed transfer width
>>>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>>>> on
>>>>>>> Intel SoCs.
>>>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>>>> exactly the values are written / read in DMA. I can share it
>>>>>> tomorrow.
>>>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>>>> if it applies cleanly on top of recent vanilla kernel.
>>> So, the original driver (with patch from M?ns) works, right?
>>>
>> The hard drive is recognized .
>> These system gets unresponsive with USB devices like the mouse and
>> keyboard not responding when I start Gparted.
> Did you disable the SATA and DMA debug messages?
>
Ah. Will try with debug disabled.
On 12/21/2015 2:27 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/21/2015 1:55 PM, Andy Shevchenko wrote:
>>> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>>>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>>>> <[email protected]> wrote:
>>>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]>
>>>>>>> wrote:
>>>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>>>> items on this board, however registers for SATA program it to 64. I
>>>>>>> remember that I got no interrupt when I programmed transfer width
>>>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>>>> on
>>>>>>> Intel SoCs.
>>>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>>>> exactly the values are written / read in DMA. I can share it
>>>>>> tomorrow.
>>>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>>>> if it applies cleanly on top of recent vanilla kernel.
>>> So, the original driver (with patch from M?ns) works, right?
>>>
>> The hard drive is recognized .
>> These system gets unresponsive with USB devices like the mouse and
>> keyboard not responding when I start Gparted.
> Did you disable the SATA and DMA debug messages?
>
It is working.
On Mon, 2015-12-21 at 18:16 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > On Mon, Dec 21, 2015 at 2:15 PM, Måns Rullgård <[email protected]>
> > wrote:
> > > Andy Shevchenko <[email protected]> writes:
> > >
> > I used to have a patch to implement this in dw_dmac driver.
> > However, I
> > dropped it at some point. Seems we need it back and now I possible
> > have a good explanation why.
>
> Are you still able to find that patch? Shouldn't be too hard to do
> from
> scratch if not.
Yes, I found a version of it, let me mock up tomorrow something
working.
>
> > > If those values didn't matter, why would the fields exist in the
> > > first place?
> >
> > Because someone can have more than one AHB bus on the system and
> > connect DMA to all of them (up to 4).
>
> Which apparently these guys did. Well, not a full-blown AHB bus, but
> they seem to be using two master interfaces.
To different buses? Intel HW uses two masters and they are quite equal
(at least from OS point of view, it might be HW adjusts it).
>
> > > > In any case on all Intel SoCs and AVR32, and as far as I can
> > > > tell on
> > > > Spear13xx (Viresh?) there is not a case, that's why I hardly
> > > > imagine
> > > > that the problem is in master numbers by themselves.
> > >
> > > The 460EX is a PowerPC system. Expect unusual topologies.
> >
> > Yeah, that's right.
>
> BTW, there's a good reason for wiring it like this. If the source
> and
> destination are on different buses, the DMA engine can do a read and
> a
> write in each cycle. Otherwise the reads and writes have to be
> issued
> alternately.
Okay. We need first to have a confirmation. I would try to set other
bits under question to see if it helps first (CFG register in DMA).
> Most likely nothing happens, but I think it ought to be
> > > > > fixed. In fact,
> > > > > I have a patch already.
> > > >
> > > > Good. Send with Fixes tag if it's upstream ready.
> > > >
> > > > > Come to think of it, I have an AVR32 dev somewhere. Maybe I
> > > > > should dust
> > > > > it off.
> > > >
> > > > I have ATNGW100.
> > >
> > > I have an AT32ATK1006. Can you suggest a good test to exercise
> > > the DMA
> > > engine?
> >
> > On that board I tried MMC (the only available user for me), though
> > it
> > is not reliable, I also tried the dmatest module.
>
> Hmm, is there anywhere this damn driver actually works? ;-)
Yes, on Intel HW.
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Andy Shevchenko <[email protected]> writes:
> On Mon, 2015-12-21 at 01:19 +0000, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>?
>> > P.S. I also noticed that original driver enables interrupt per each
>> > block
>>
>> And then ignores all but the transfer complete interrupt.
>>
>> > and sets protection control bits.
>>
>> With no indication what the value it sets is supposed to mean.
>
> Okay, let's summarize what we have:
>
> 0. AR: Get a working reference for PPC 460EX SATA driver
Do we consider Julian's latest result working?
> 1. AR: Clear LLP_EN bits at the last block of LLP transfer
Patch sent.
> 2. AR: Rename masters to 'memory' and 'peripheral' and change them per
> DMA direction
Good idea. I'd call them memory and device though to match existing
dmaengine nomenclature.
> 3. AR: Set LMS (LLP master) to 'memory' when do LLP transfers
I started working on a patch for that already.
> 4. CHECK: PROTCTL bit (documentation says that recommended value is
> 0x01)
Any idea what the value of 0x3 used by the old sata driver means?
Presumably that's decided by the bus.
> 5. CHECK: Other bits in CFG register (FIFO_MODE, FCMODE)
> 6. CHECK: Block interrupts vs. one interrupt at the end of block chain
> (M?ns, I missed how any of them is ignored)
The interrupt handler looks at the StatusTfr and StatusErr registers and
ignores StatusBlock.
> 7. AR: Test everything on Intel SoCs such as Baytrail, CherryTrail, etc
> (SPI, UART, dmatest), AVR32 (MMC, dmatest), PPC 460EX (Onboard SATA)
I can test on AVR32. That is as far as I know the only system I have
with this DMA engine.
> I can share my working branch with a set of patches regarding to
> dw_dmac. We may do our work based on that code and after I'll submit
> everything to upstream. Does it sound okay for you, guys?
I'm going away for the holidays, so I won't be able to do any serious
work on this until January, but I'll keep an eye on emails and may even
reply occasionally. Before I go, I'll publish my patches so far
whatever shape they're in.
--
M?ns Rullg?rd
Julian Margetson <[email protected]> writes:
> On 12/21/2015 2:27 PM, M?ns Rullg?rd wrote:
>> Julian Margetson <[email protected]> writes:
>>
>>> On 12/21/2015 1:55 PM, Andy Shevchenko wrote:
>>>> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>>>>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>>>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>>>>> <[email protected]> wrote:
>>>>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]>
>>>>>>>> wrote:
>>>>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>>>>> items on this board, however registers for SATA program it to 64. I
>>>>>>>> remember that I got no interrupt when I programmed transfer width
>>>>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>>>>> on
>>>>>>>> Intel SoCs.
>>>>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>>>>> exactly the values are written / read in DMA. I can share it
>>>>>>> tomorrow.
>>>>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>>>>> if it applies cleanly on top of recent vanilla kernel.
>>>> So, the original driver (with patch from M?ns) works, right?
>>>>
>>> The hard drive is recognized .
>>> These system gets unresponsive with USB devices like the mouse and
>>> keyboard not responding when I start Gparted.
>> Did you disable the SATA and DMA debug messages?
>>
> It is working.
That's good news. Thanks a lot for helping to test this.
--
M?ns Rullg?rd
On 12/21/2015 3:27 PM, M?ns Rullg?rd wrote:
> Julian Margetson <[email protected]> writes:
>
>> On 12/21/2015 2:27 PM, M?ns Rullg?rd wrote:
>>> Julian Margetson <[email protected]> writes:
>>>
>>>> On 12/21/2015 1:55 PM, Andy Shevchenko wrote:
>>>>> On Mon, Dec 21, 2015 at 7:26 PM, Julian Margetson <[email protected]> wrote:
>>>>>> On 12/21/2015 12:48 PM, Andy Shevchenko wrote:
>>>>>>> On Sun, 2015-12-20 at 22:55 +0200, Andy Shevchenko wrote:
>>>>>>>> On Sun, Dec 20, 2015 at 10:17 PM, Andy Shevchenko
>>>>>>>> <[email protected]> wrote:
>>>>>>>>> On Sun, Dec 20, 2015 at 8:49 PM, M?ns Rullg?rd <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>> I noticed thanks to DWC_PARAMS that burst size is hardcoded to 32
>>>>>>>>> items on this board, however registers for SATA program it to 64. I
>>>>>>>>> remember that I got no interrupt when I programmed transfer width
>>>>>>>>> wrongly (64 bits against 32 bits) when I ported dw_dmac to be used
>>>>>>>>> on
>>>>>>>>> Intel SoCs.
>>>>>>>> One more thing, I have a patch to monitor DMA IO, we may check what
>>>>>>>> exactly the values are written / read in DMA. I can share it
>>>>>>>> tomorrow.
>>>>>>> As promised the patch I have to debug IO of DW DMA. Didn't check though
>>>>>>> if it applies cleanly on top of recent vanilla kernel.
>>>>> So, the original driver (with patch from M?ns) works, right?
>>>>>
>>>> The hard drive is recognized .
>>>> These system gets unresponsive with USB devices like the mouse and
>>>> keyboard not responding when I start Gparted.
>>> Did you disable the SATA and DMA debug messages?
>>>
>> It is working.
> That's good news. Thanks a lot for helping to test this.
>
No problem.
If you can influence anyone of the radeon guys to have a look at the
ring test failure on the Sam460ex again,
I will be happy to help test in that area as well .
http://lists.freedesktop.org/archives/dri-devel/2013-September/045050.html
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-February/125060.html
Andy Shevchenko <[email protected]> writes:
> On Mon, 2015-12-21 at 18:16 +0000, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>> > On Mon, Dec 21, 2015 at 2:15 PM, M?ns Rullg?rd <[email protected]>
>> > wrote:
>> > > Andy Shevchenko <[email protected]> writes:
>> > >?
>> > I used to have a patch to implement this in dw_dmac driver.
>> > However, I
>> > dropped it at some point. Seems we need it back and now I possible
>> > have a good explanation why.
>>
>> Are you still able to find that patch???Shouldn't be too hard to do
>> from scratch if not.
>
> Yes, I found a version of it, let me mock up tomorrow something
> working.
>
>>
>> > > If those values didn't matter, why would the fields exist in the
>> > > first place?
>> >
>> > Because someone can have more than one AHB bus on the system and
>> > connect DMA to all of them (up to 4).
>>
>> Which apparently these guys did.??Well, not a full-blown AHB bus, but
>> they seem to be using two master interfaces.
>
> To different buses? Intel HW uses two masters and they are quite equal
> (at least from OS point of view, it might be HW adjusts it).
Judging by the block diagram in the 460EX datasheet [1], and by the fact
that the old SATA driver works despite using an invalid address, the DMA
FIFO of the controller isn't connected to the AHB bus at all but
directly to master 0 on the DW DMA controller. Master 1 of the DMA
controller is connected to the AHB bus, which is bridged to the main
system bus.
I haven't managed to find a full manual for the 460EX.
[1] http://datasheet.octopart.com/PPC460EX-NUB800T-AMCC-datasheet-11553412.pdf
--
M?ns Rullg?rd
On Mon, 2015-12-21 at 15:19 -0400, Julian Margetson wrote:
> On 12/21/2015 2:27 PM, Måns Rullgård wrote:
> > The hard drive is recognized .
> > > These system gets unresponsive with USB devices like the mouse
> > > and
> > > keyboard not responding when I start Gparted.
> > Did you disable the SATA and DMA debug messages?
> >
> It is working.
Indeed, thanks, Julian!
I might ask you to test my branch with set of patches when it will be
ready (apparently after Xmas) if you are okay with that.
Måns, also I would ask you to test on your hardware (AVR32) as well if
you have no objections.
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
On 12/21/2015 4:25 PM, Andy Shevchenko wrote:
> On Mon, 2015-12-21 at 15:19 -0400, Julian Margetson wrote:
>> On 12/21/2015 2:27 PM, Måns Rullgård wrote:
>>> The hard drive is recognized .
>>>> These system gets unresponsive with USB devices like the mouse
>>>> and
>>>> keyboard not responding when I start Gparted.
>>> Did you disable the SATA and DMA debug messages?
>>>
>> It is working.
> Indeed, thanks, Julian!
>
> I might ask you to test my branch with set of patches when it will be
> ready (apparently after Xmas) if you are okay with that.
>
> Måns, also I would ask you to test on your hardware (AVR32) as well if
> you have no objections.
>
I have no problem testing.
Regards
Julian
Andy Shevchenko <[email protected]> writes:
> On Mon, 2015-12-21 at 15:19 -0400, Julian Margetson wrote:
>> On 12/21/2015 2:27 PM, M?ns Rullg?rd wrote:
>> > The hard drive is recognized .
>> > > These system gets unresponsive with USB devices like the mouse
>> > > and
>> > > keyboard not responding??when I start Gparted.
>> > Did you disable the SATA and DMA debug messages?
>> >
>> It is working.
>
> Indeed, thanks, Julian!
>
> I might ask you to test my branch with set of patches when it will be
> ready (apparently after Xmas) if you are okay with that.
>
> M?ns, also I would ask you to test on your hardware (AVR32) as well if
> you have no objections.
Sure, but it will have to wait until January.
--
M?ns Rullg?rd
On Mon, 2015-12-21 at 19:27 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > On Mon, 2015-12-21 at 01:19 +0000, Måns Rullgård wrote:
> > > Andy Shevchenko <[email protected]> writes:
> > >
> > > > P.S. I also noticed that original driver enables interrupt per
> > > > each
> > > > block
> > >
> > > And then ignores all but the transfer complete interrupt.
> > >
> > > > and sets protection control bits.
> > >
> > > With no indication what the value it sets is supposed to mean.
> >
> > Okay, let's summarize what we have:
> >
> > 0. AR: Get a working reference for PPC 460EX SATA driver
>
> Do we consider Julian's latest result working?
I think so.
>
> > 1. AR: Clear LLP_EN bits at the last block of LLP transfer
>
> Patch sent.
Acked.
>
> > 2. AR: Rename masters to 'memory' and 'peripheral' and change them
> > per
> > DMA direction
>
> Good idea. I'd call them memory and device though to match existing
> dmaengine nomenclature.
I remember how I called in my patch. So, there is no problem to rename,
but will see.
>
> > 3. AR: Set LMS (LLP master) to 'memory' when do LLP transfers
>
> I started working on a patch for that already.
Thanks.
>
> > 4. CHECK: PROTCTL bit (documentation says that recommended value is
> > 0x01)
>
> Any idea what the value of 0x3 used by the old sata driver means?
> Presumably that's decided by the bus.
Nope, documentation says that it is direct representation of hprot[3:1]
wires on the master interface. Also it refers to AMBA spec, so, if you
have access to AMBA spec I think we might get it from there.
>
> > 5. CHECK: Other bits in CFG register (FIFO_MODE, FCMODE)
> > 6. CHECK: Block interrupts vs. one interrupt at the end of block
> > chain
> > (Måns, I missed how any of them is ignored)
>
> The interrupt handler looks at the StatusTfr and StatusErr registers
> and
> ignores StatusBlock.
I have to refresh my memory, since BLOCK interrupts should be enabled
(unmasked) separately. I have forgotten which type of interrupt is
generated in this case, BLOCK, or XFER after each block, or only one
XFER at the last block (LLP.LOC = 0) and BLOCK are ignored. So, will
check later.
>
> > 7. AR: Test everything on Intel SoCs such as Baytrail, CherryTrail,
> > etc
> > (SPI, UART, dmatest), AVR32 (MMC, dmatest), PPC 460EX (Onboard
> > SATA)
>
> I can test on AVR32. That is as far as I know the only system I have
> with this DMA engine.
If you have Intel Haswell, BayTrail, Braswell, CherryTrail, Broadwell,
you have it as well as long you have LPSS block there. (Most of them
are Atoms).
>
> > I can share my working branch with a set of patches regarding to
> > dw_dmac. We may do our work based on that code and after I'll
> > submit
> > everything to upstream. Does it sound okay for you, guys?
>
> I'm going away for the holidays, so I won't be able to do any serious
> work on this until January, but I'll keep an eye on emails and may
> even
> reply occasionally. Before I go, I'll publish my patches so far
> whatever shape they're in.
Okay, thanks! I will include them in my branch which I'm going to
publish on GitHUB.
Happy holidays!
--
Andy Shevchenko <[email protected]>
Intel Finland Oy
Andy Shevchenko <[email protected]> writes:
>> > 4. CHECK: PROTCTL bit (documentation says that recommended value is
>> > 0x01)
>>
>> Any idea what the value of 0x3 used by the old sata driver means?
>> Presumably that's decided by the bus.
>
> Nope, documentation says that it is direct representation of hprot[3:1]
> wires on the master interface. Also it refers to AMBA spec, so, if you
> have access to AMBA spec I think we might get it from there.
That's assuming AMCC didn't change something.
>> > 5. CHECK: Other bits in CFG register (FIFO_MODE, FCMODE)
>> > 6. CHECK: Block interrupts vs. one interrupt at the end of block
>> > chain
>> > (M?ns, I missed how any of them is ignored)
>>
>> The interrupt handler looks at the StatusTfr and StatusErr registers
>> and ignores StatusBlock.
>
> I have to refresh my memory, since BLOCK interrupts should be enabled
> (unmasked) separately. I have forgotten which type of interrupt is
> generated in this case, BLOCK, or XFER after each block, or only one
> XFER at the last block (LLP.LOC = 0) and BLOCK are ignored. So, will
> check later.
I interpreted the, admittedly a bit vague, documentation as meaning
BLOCK interrupts are signalled after each block and XFER interrupts
after the last block.
>> > 7. AR: Test everything on Intel SoCs such as Baytrail, CherryTrail,
>> > etc (SPI, UART, dmatest), AVR32 (MMC, dmatest), PPC 460EX (Onboard
>> > SATA)
>>
>> I can test on AVR32.??That is as far as I know the only system I have
>> with this DMA engine.
>
> If you have Intel Haswell, BayTrail, Braswell, CherryTrail, Broadwell,
> you have it as well as long you have LPSS block there. (Most of them
> are Atoms).
I don't have any of those (or any Atom hardware).
--
M?ns Rullg?rd
Andy Shevchenko <[email protected]> writes:
> On Mon, 2015-12-21 at 19:27 +0000, M?ns Rullg?rd wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>> > I can share my working branch with a set of patches regarding to
>> > dw_dmac. We may do our work based on that code and after I'll
>> > submit
>> > everything to upstream. Does it sound okay for you, guys?
>>
>> I'm going away for the holidays, so I won't be able to do any serious
>> work on this until January, but I'll keep an eye on emails and may
>> even reply occasionally.??Before I go, I'll publish my patches so far
>> whatever shape they're in.
>
> Okay, thanks! I will include them in my branch which I'm going to
> publish on GitHUB.
Here's what I have: https://bitbucket.org/mansr/linux-dwc
Bitbucket because Github won't let me have more than one Linux
repo.
--
M?ns Rullg?rd
On Tue, 2015-12-22 at 00:08 +0000, Måns Rullgård wrote:
> Andy Shevchenko <[email protected]> writes:
>
> > On Mon, 2015-12-21 at 19:27 +0000, Måns Rullgård wrote:
> > > Andy Shevchenko <[email protected]> writes:
> > >
> > > > I can share my working branch with a set of patches regarding
> > > > to
> > > > dw_dmac. We may do our work based on that code and after I'll
> > > > submit
> > > > everything to upstream. Does it sound okay for you, guys?
> > >
> > > I'm going away for the holidays, so I won't be able to do any
> > > serious
> > > work on this until January, but I'll keep an eye on emails and
> > > may
> > > even reply occasionally. Before I go, I'll publish my patches so
> > > far
> > > whatever shape they're in.
> >
> > Okay, thanks! I will include them in my branch which I'm going to
> > publish on GitHUB.
>
> Here's what I have: https://bitbucket.org/mansr/linux-dwc
> Bitbucket because Github won't let me have more than one Linux
> repo.
Thanks, got it.
Will base my stuff on what you had done already.
--
Andy Shevchenko <[email protected]>
Intel Finland Oy