Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 194471 Details for
Bug 242229
[pata_it821x] Hang on module load - IRQ routing ?
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch adding debugging code to the module
pata_it821x-debug038.patch (text/plain), 13.53 KB, created by
Martin von Gagern
on 2007-09-13 10:40:06 UTC
(
hide
)
Description:
Patch adding debugging code to the module
Filename:
MIME Type:
Creator:
Martin von Gagern
Created:
2007-09-13 10:40:06 UTC
Size:
13.53 KB
patch
obsolete
>--- linux-2.6.23-rc6.orig/drivers/ata/pata_it821x.c 2007-09-13 11:45:09.000000000 +0200 >+++ linux-2.6.23-rc6/drivers/ata/pata_it821x.c 2007-09-13 11:56:18.000000000 +0200 >@@ -76,11 +76,12 @@ > #include <linux/blkdev.h> > #include <linux/delay.h> > #include <scsi/scsi_host.h> >+#include <scsi/scsi_cmnd.h> > #include <linux/libata.h> > > > #define DRV_NAME "pata_it821x" >-#define DRV_VERSION "0.3.8" >+#define DRV_VERSION "0.3.8-debug" > > struct it821x_dev > { >@@ -103,6 +104,25 @@ struct it821x_dev > #define UDMA_OFF 0 > #define MWDMA_OFF 0 > >+/* Debug macro, jsn Wed Aug 22 10:00:44 2007 */ >+static int it821x_debug=0; >+#define ITDBG if (it821x_debug){printk(KERN_ERR "ite-dbg: %s\n", __func__);} >+#define ITDBG_ENTER if (it821x_debug){printk(KERN_ERR "ite-dbg: entering %s\n", __func__);} >+#define ITDBG_LEAVE if (it821x_debug){printk(KERN_ERR "ite-dbg: leaving %s\n", __func__);} >+ >+/* Paramaters to try in order to fix atapi dma problems, jsn */ >+static int it821x_nodma=0; //Instead of the libata parameter >+ >+static int it_flush=0; //use wmb() after each dma_start() call, as in >+ //the older ide code. DOESN'T SEEM TO HELP. >+ >+static int it_reprogram=0; //Call it821_program_udma() before each >+ //dma_start, as in the timing10 workaround. >+ //DOESN'T SEEM TO HELP. >+ >+static int it_mindma=2048; //Min size of dma-transfer. 2048 will only use >+ //dma for transfers to/from media >+ > /* > * We allow users to force the card into non raid mode without > * flashing the alternative BIOS. This is also neccessary right now >@@ -130,6 +150,7 @@ static void it821x_program(struct ata_po > int channel = ap->port_no; > u8 conf; > >+ ITDBG; > /* Program PIO/MWDMA timing bits */ > if (itdev->clock_mode == ATA_66) > conf = timing >> 8; >@@ -159,6 +180,7 @@ static void it821x_program_udma(struct a > int unit = adev->devno; > u8 conf; > >+ ITDBG; > /* Program UDMA timing bits */ > if (itdev->clock_mode == ATA_66) > conf = timing >> 8; >@@ -193,6 +215,7 @@ static void it821x_clock_strategy(struct > u8 v; > int sel = 0; > >+ ITDBG; > /* Look for the most wanted clocking */ > if (itdev->want[0][0] > itdev->want[1][0]) { > clock = itdev->want[0][1]; >@@ -262,6 +285,7 @@ static void it821x_passthru_set_piomode( > int unit = adev->devno; > int mode_wanted = adev->pio_mode - XFER_PIO_0; > >+ ITDBG; > /* We prefer 66Mhz clock for PIO 0-3, don't care for PIO4 */ > itdev->want[unit][1] = pio_want[mode_wanted]; > itdev->want[unit][0] = 1; /* PIO is lowest priority */ >@@ -295,6 +319,7 @@ static void it821x_passthru_set_dmamode( > int unit = adev->devno; > u8 conf; > >+ ITDBG; > if (adev->dma_mode >= XFER_UDMA_0) { > int mode_wanted = adev->dma_mode - XFER_UDMA_0; > >@@ -349,11 +374,37 @@ static void it821x_passthru_bmdma_start( > struct it821x_dev *itdev = ap->private_data; > int unit = adev->devno; > >- if (itdev->mwdma[unit] != MWDMA_OFF) >- it821x_program(ap, adev, itdev->mwdma[unit]); >- else if (itdev->udma[unit] != UDMA_OFF && itdev->timing10) >- it821x_program_udma(ap, adev, itdev->udma[unit]); >+ ITDBG_ENTER; // printk(" class=%d\n", adev->class); >+ if (itdev->mwdma[unit] != MWDMA_OFF) { >+ if (it821x_debug) >+ printk("ite-dbg: programming mwdma\n"); >+ it821x_program(ap, adev, itdev->mwdma[unit]); >+ } >+ //jsn >+ //else if (itdev->udma[unit] != UDMA_OFF && itdev->timing10) { >+ //else if (itdev->udma[unit] != UDMA_OFF && (itdev->timing10 || (adev->class == ATA_DEV_ATAPI))) { >+ else if (itdev->udma[unit] != UDMA_OFF && it_reprogram) { >+ if (it821x_debug) >+ printk("ite-dbg: programming udma\n"); >+ it821x_program_udma(ap, adev, itdev->udma[unit]); >+ } > ata_bmdma_start(qc); >+ >+ if (it_flush) >+ wmb(); >+ >+#if 0 >+ /* Attempt to flush the write by reading status. THIS DOESN'T WORK! */ >+ { >+ int sret,bsret=0; >+ >+ sret=ata_check_status(ap); >+ bsret=ata_bmdma_status(ap); >+ if (it821x_debug) >+ printk("ite-dbg: check_status=0x%X bmdma_status=0x%X\n", sret,bsret); >+#endif >+ >+ ITDBG_LEAVE; > } > > /** >@@ -372,6 +423,7 @@ static void it821x_passthru_bmdma_stop(s > struct it821x_dev *itdev = ap->private_data; > int unit = adev->devno; > >+ ITDBG; > ata_bmdma_stop(qc); > if (itdev->mwdma[unit] != MWDMA_OFF) > it821x_program(ap, adev, itdev->pio[unit]); >@@ -390,6 +442,8 @@ static void it821x_passthru_dev_select(s > unsigned int device) > { > struct it821x_dev *itdev = ap->private_data; >+ >+ ITDBG; > if (itdev && device != itdev->last_device) { > struct ata_device *adev = &ap->device[device]; > it821x_program(ap, adev, itdev->pio[adev->devno]); >@@ -409,6 +463,8 @@ static void it821x_passthru_dev_select(s > > static unsigned int it821x_smart_qc_issue_prot(struct ata_queued_cmd *qc) > { >+ >+ ITDBG; > switch(qc->tf.command) > { > /* Commands the firmware supports */ >@@ -444,6 +500,11 @@ static unsigned int it821x_smart_qc_issu > > static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) > { >+ >+ if (it821x_debug){ >+ printk("ite-dbg: %s cmd is 0x%X, proto is 0x%X\n", >+ __func__, qc->tf.command, qc->tf.protocol); >+ }; > it821x_passthru_dev_select(qc->ap, qc->dev->devno); > return ata_qc_issue_prot(qc); > } >@@ -462,7 +523,7 @@ static unsigned int it821x_passthru_qc_i > static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused) > { > int i; >- >+ ITDBG; > for (i = 0; i < ATA_MAX_DEVICES; i++) { > struct ata_device *dev = &ap->device[i]; > if (ata_dev_enabled(dev)) { >@@ -503,6 +564,7 @@ static void it821x_dev_config(struct ata > { > unsigned char model_num[ATA_ID_PROD_LEN + 1]; > >+ ITDBG; > ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); > > if (adev->max_sectors > 255) >@@ -532,10 +594,21 @@ static int it821x_check_atapi_dma(struct > { > struct ata_port *ap = qc->ap; > struct it821x_dev *itdev = ap->private_data; >+ static int i; > >- /* Only use dma for transfers to/from the media. */ >- if (qc->nbytes < 2048) >- return -EOPNOTSUPP; >+ if (it821x_debug){ >+ printk("ite-dbg: %s: nbytes=%u, flags=0x%lX, n_elem=%u, sect_size=%u\n" >+ " scsi-request_bufflen=%u, scsi-cmd_len=%u\n", >+ __func__, >+ qc->nbytes, qc->flags, qc->n_elem, qc->sect_size, >+ qc->scsicmd->request_bufflen, qc->scsicmd->cmd_len); >+ printk(" scsi-cmd="); >+ for (i=0; i < qc->scsicmd->cmd_len; i++) >+ printk("%02X ", qc->scsicmd->cmnd[i]); >+ printk("\n"); >+ >+ >+ } > > /* No ATAPI DMA in smart mode */ > if (itdev->smart) >@@ -543,6 +616,16 @@ static int it821x_check_atapi_dma(struct > /* No ATAPI DMA on rev 10 */ > if (itdev->timing10) > return -EOPNOTSUPP; >+ >+ /*limit DMA based on then size of the transfer jsn*/ >+ //if (qc->nbytes == 0) { >+ //if ( (qc->nbytes < qc->sect_size) || (it821x_nodma) ) { >+ if ( (qc->nbytes < it_mindma) || (it821x_nodma) ) { >+ if (it821x_debug) >+ printk("ite-dbg: cancelling dma!\n"); >+ return -EOPNOTSUPP; >+ } >+ > /* Cool */ > return 0; > } >@@ -563,8 +646,9 @@ static int it821x_port_start(struct ata_ > struct pci_dev *pdev = to_pci_dev(ap->host->dev); > struct it821x_dev *itdev; > u8 conf; >- > int ret = ata_port_start(ap); >+ >+ ITDBG; > if (ret < 0) > return ret; > >@@ -591,6 +675,9 @@ static int it821x_port_start(struct ata_ > itdev->want[1][1] = ATA_ANY; > itdev->last_device = -1; > >+ if (it821x_debug) >+ printk(KERN_ERR "ite-dbg: rev id is %x\n", pdev->revision); >+ > if (pdev->revision == 0x10) { > itdev->timing10 = 1; > /* Need to disable ATAPI DMA for this case */ >@@ -656,45 +743,196 @@ static struct ata_port_operations it821x > .port_start = it821x_port_start, > }; > >+/**** JSN - add more debugs *********/ >+irqreturn_t >+it_ata_interrupt (int irq, void *dev_instance) { >+ ITDBG; >+ return(ata_interrupt(irq, dev_instance)); >+} >+ >+u8 >+it_ata_irq_on(struct ata_port *ap) { >+ ITDBG; >+ return(ata_irq_on(ap)); >+} >+ >+u8 >+it_ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) { >+ ITDBG; >+ return(ata_irq_ack(ap, chk_drq)); >+} >+ >+void >+it_ata_bmdma_irq_clear(struct ata_port *ap) { >+ ITDBG; >+ return(ata_bmdma_irq_clear(ap)); >+} >+ >+#if 0 >+void >+it_ata_bmdma_freeze(struct ata_port *ap){ >+ ITDBG_ENTER; >+ ata_bmdma_freeze_dbg(ap); >+ ITDBG_LEAVE; >+} >+#endif >+ >+void it_ata_bmdma_freeze(struct ata_port *ap) >+{ >+ struct ata_ioports *ioaddr = &ap->ioaddr; >+ >+ ap->ctl |= ATA_NIEN; >+ ap->last_ctl = ap->ctl; >+ >+ if (it821x_debug) >+ printk(KERN_ERR "ite-dbg: freeze routine - entering\n"); >+ iowrite8(ap->ctl, ioaddr->ctl_addr); >+ >+ if (it821x_debug) >+ printk(KERN_ERR "ite-dbg: freeze routine - iowrite8 done\n"); >+ /* Under certain circumstances, some controllers raise IRQ on >+ * ATA_NIEN manipulation. Also, many controllers fail to mask >+ * previously pending IRQ on ATA_NIEN assertion. Clear it. >+ */ >+ ata_chk_status(ap); >+ >+ if (it821x_debug) >+ printk(KERN_ERR "ite-dbg: freeze routine - ck_status done\n"); >+ >+ ap->ops->irq_clear(ap); >+ >+ if (it821x_debug) >+ printk(KERN_ERR "ite-dbg: freeze routine - leaving\n"); >+ >+} >+ >+void >+it_ata_bmdma_thaw(struct ata_port *ap){ >+ ITDBG; >+ return(ata_bmdma_thaw(ap)); >+} >+ >+void >+it_ata_bmdma_error_handler(struct ata_port *ap){ >+ ITDBG; >+ return(ata_bmdma_error_handler(ap)); >+} >+ >+void >+it_ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc){ >+ ITDBG; >+ return(ata_bmdma_post_internal_cmd(qc)); >+} >+ >+void >+it_ata_bmdma_setup(struct ata_queued_cmd *qc){ >+ ITDBG; >+ return(ata_bmdma_setup(qc)); >+} >+ >+u8 >+it_ata_bmdma_status(struct ata_port *ap){ >+ ITDBG; >+ return(ata_bmdma_status(ap)); >+} >+ >+void >+it_ata_data_xfer(struct ata_device *adev, unsigned char *buf, unsigned int buflen, int write_data){ >+ ITDBG; >+ return(ata_data_xfer(adev, buf, buflen, write_data)); >+} >+ >+void >+it_ata_qc_prep(struct ata_queued_cmd *qc){ >+ ITDBG; >+ return(ata_qc_prep(qc)); >+} >+ >+void >+it_ata_port_disable(struct ata_port *ap){ >+ ITDBG; >+ return(ata_port_disable(ap)); >+} >+ >+unsigned long >+it_ata_pci_default_filter(struct ata_device *adev, unsigned long xfer_mask){ >+ ITDBG; >+ return(ata_pci_default_filter(adev, xfer_mask)); >+} >+ >+void >+it_ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf){ >+ ITDBG; >+ return(ata_tf_load(ap, tf)); >+} >+ >+void >+it_ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf){ >+ ITDBG; >+ return(ata_tf_read(ap, tf)); >+} >+ >+u8 >+it_ata_check_status(struct ata_port *ap){ >+ ITDBG; >+ return(ata_check_status(ap)); >+} >+ >+void >+it_ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf){ >+ ITDBG; >+ return(ata_exec_command(ap, tf)); >+} >+ >+int >+it_ata_cable_unknown(struct ata_port *ap){ >+ ITDBG; >+ return(ata_cable_unknown(ap)); >+} >+ >+/**** JSN done *********/ >+ > static struct ata_port_operations it821x_passthru_port_ops = { >- .port_disable = ata_port_disable, >+ .port_disable = it_ata_port_disable, > .set_piomode = it821x_passthru_set_piomode, > .set_dmamode = it821x_passthru_set_dmamode, >- .mode_filter = ata_pci_default_filter, >+ .mode_filter = it_ata_pci_default_filter, > >- .tf_load = ata_tf_load, >- .tf_read = ata_tf_read, >- .check_status = ata_check_status, >- .exec_command = ata_exec_command, >+ .tf_load = it_ata_tf_load, >+ .tf_read = it_ata_tf_read, >+ .check_status = it_ata_check_status, >+ .exec_command = it_ata_exec_command, > .check_atapi_dma= it821x_check_atapi_dma, > .dev_select = it821x_passthru_dev_select, > >- .freeze = ata_bmdma_freeze, >- .thaw = ata_bmdma_thaw, >- .error_handler = ata_bmdma_error_handler, >- .post_internal_cmd = ata_bmdma_post_internal_cmd, >- .cable_detect = ata_cable_unknown, >+ .freeze = it_ata_bmdma_freeze, >+ .thaw = it_ata_bmdma_thaw, >+ .error_handler = it_ata_bmdma_error_handler, >+ .post_internal_cmd = it_ata_bmdma_post_internal_cmd, >+ .cable_detect = it_ata_cable_unknown, > >- .bmdma_setup = ata_bmdma_setup, >+ .bmdma_setup = it_ata_bmdma_setup, > .bmdma_start = it821x_passthru_bmdma_start, > .bmdma_stop = it821x_passthru_bmdma_stop, >- .bmdma_status = ata_bmdma_status, >+ .bmdma_status = it_ata_bmdma_status, > >- .qc_prep = ata_qc_prep, >+ .qc_prep = it_ata_qc_prep, > .qc_issue = it821x_passthru_qc_issue_prot, > >- .data_xfer = ata_data_xfer, >+ .data_xfer = it_ata_data_xfer, > >- .irq_clear = ata_bmdma_irq_clear, >- .irq_handler = ata_interrupt, >- .irq_on = ata_irq_on, >- .irq_ack = ata_irq_ack, >+ .irq_clear = it_ata_bmdma_irq_clear, >+ .irq_handler = it_ata_interrupt, >+ .irq_on = it_ata_irq_on, >+ .irq_ack = it_ata_irq_ack, > > .port_start = it821x_port_start, >-}; >+ }; > > static void it821x_disable_raid(struct pci_dev *pdev) > { >+ >+ ITDBG; > /* Reset local CPU, and set BIOS not ready */ > pci_write_config_byte(pdev, 0x5E, 0x01); > >@@ -734,6 +972,7 @@ static int it821x_init_one(struct pci_de > const struct ata_port_info *ppi[] = { NULL, NULL }; > static char *mode[2] = { "pass through", "smart" }; > >+ ITDBG; > /* Force the card into bypass mode if so requested */ > if (it8212_noraid) { > printk(KERN_INFO DRV_NAME ": forcing bypass mode.\n"); >@@ -781,11 +1020,14 @@ static struct pci_driver it821x_pci_driv > > static int __init it821x_init(void) > { >+ ITDBG; > return pci_register_driver(&it821x_pci_driver); > } > > static void __exit it821x_exit(void) > { >+ >+ ITDBG; > pci_unregister_driver(&it821x_pci_driver); > } > >@@ -799,5 +1041,21 @@ MODULE_VERSION(DRV_VERSION); > module_param_named(noraid, it8212_noraid, int, S_IRUGO); > MODULE_PARM_DESC(noraid, "Force card into bypass mode"); > >+module_param_named(debug, it821x_debug, int, S_IRUGO | S_IWUSR); >+MODULE_PARM_DESC(debug, "print debug info"); >+ >+module_param_named(nodma, it821x_nodma, int, S_IRUGO | S_IWUSR); >+MODULE_PARM_DESC(nodma, "disable dma"); >+ >+////extras >+module_param_named(flush, it_flush, int, S_IRUGO | S_IWUSR); >+MODULE_PARM_DESC(flush, "use wmb()"); >+ >+module_param_named(reprogram, it_reprogram, int, S_IRUGO | S_IWUSR); >+MODULE_PARM_DESC(reprogram, "extra bmdam_program() calls"); >+ >+module_param_named(mindma, it_mindma, int, S_IRUGO | S_IWUSR); >+MODULE_PARM_DESC(mindma, "min dma buffer size"); >+ > module_init(it821x_init); > module_exit(it821x_exit);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 242229
:
156488
|
156489
|
160935
|
160936
|
160937
|
164589
|
164590
|
179641
|
194461
| 194471