after some more testing i am more and more convinced this is a (very)
strange race at boot time.

Adding this patch to add some debugging printk to libata will make the
system crash once every 6/10 reboots. Without it boots once every 4/5
boots.

--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3265,6 +3265,9 @@ static void ata_sg_clean(struct ata_queu
                /* restore last sg */
                sg[qc->orig_n_elem - 1].length += qc->pad_len;
                if (pad_buf) {
+                       printk(KERN_CRIT "kmap_atomic from: ata_sg_clean\n");
+               }
+               if (pad_buf) {
                        struct scatterlist *psg = &qc->pad_sgent;
                        void *addr = kmap_atomic(psg->page, KM_IRQ0);
                        memcpy(addr + psg->offset, pad_buf, qc->pad_len);
@@ -3546,6 +3549,9 @@ static int ata_sg_setup(struct ata_queue
                psg->offset = offset_in_page(offset);
 
                if (qc->tf.flags & ATA_TFLAG_WRITE) {
+                       printk(KERN_CRIT "kmap_atomic from: ata_sg_setup\n");
+               }
+               if (qc->tf.flags & ATA_TFLAG_WRITE) {
                        void *addr = kmap_atomic(psg->page, KM_IRQ0);
                        memcpy(pad_buf, addr + psg->offset, qc->pad_len);
                        kunmap_atomic(addr, KM_IRQ0);
@@ -3755,6 +3761,7 @@ static void ata_pio_sector(struct ata_qu
 
                /* FIXME: use a bounce buffer */
                local_irq_save(flags);
+               printk(KERN_CRIT "kmap_atomic from: ata_pio_sector\n");
                buf = kmap_atomic(page, KM_IRQ0);
 
                /* do the actual data transfer */
@@ -3908,6 +3915,7 @@ next_sg:
 
                /* FIXME: use bounce buffer */
                local_irq_save(flags);
+               printk(KERN_CRIT "kmap_atomic from: __atapi_pio_bytes\n");
                buf = kmap_atomic(page, KM_IRQ0);
 
                /* do the actual data transfer */
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 5c1fc46..9232929 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1646,6 +1646,7 @@ static unsigned int ata_scsi_rbuf_get(st
                struct scatterlist *sg;
 
                sg = (struct scatterlist *) cmd->request_buffer;
+               printk(KERN_CRIT "kmap_atomic from: ata_scsi_rbuf_get\n");
                buf = kmap_atomic(sg->page, KM_USER0) + sg->offset;
                buflen = sg->length;
        } else {

I still cannot see crashes when using ata_generic.

Fabio

-- 
pata_via causes random crashes at boot
https://launchpad.net/bugs/72824

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to