* [PATCH] Re: AHCI oops
[not found] <200502200256.j1K2uKJ23938@tench.street-vision.com>
@ 2005-02-23 2:48 ` Jeff Garzik
2005-02-23 15:56 ` Brett Russ
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Garzik @ 2005-02-23 2:48 UTC (permalink / raw)
To: Justin Cormack; +Cc: linux-ide@vger.kernel.org, Linux Kernel, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 85 bytes --]
Can you try this patch?
If it fixes the oops, I'll forward upstream ASAP.
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 4632 bytes --]
===== drivers/scsi/ahci.c 1.14 vs edited =====
--- 1.14/drivers/scsi/ahci.c 2005-02-13 19:58:01 -05:00
+++ edited/drivers/scsi/ahci.c 2005-02-22 21:46:25 -05:00
@@ -179,6 +179,7 @@
static void ahci_host_stop(struct ata_host_set *host_set);
static void ahci_qc_prep(struct ata_queued_cmd *qc);
static u8 ahci_check_status(struct ata_port *ap);
+static u8 ahci_check_err(struct ata_port *ap);
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
static Scsi_Host_Template ahci_sht = {
@@ -204,6 +205,8 @@
.port_disable = ata_port_disable,
.check_status = ahci_check_status,
+ .check_altstatus = ahci_check_status,
+ .check_err = ahci_check_err,
.dev_select = ata_noop_dev_select,
.phy_reset = ahci_phy_reset,
@@ -450,6 +453,13 @@
void *mmio = (void *) ap->ioaddr.cmd_addr;
return readl(mmio + PORT_TFDATA) & 0xFF;
+}
+
+static u8 ahci_check_err(struct ata_port *ap)
+{
+ void *mmio = (void *) ap->ioaddr.cmd_addr;
+
+ return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
}
static void ahci_fill_sg(struct ata_queued_cmd *qc)
===== drivers/scsi/libata-core.c 1.120 vs edited =====
--- 1.120/drivers/scsi/libata-core.c 2005-02-22 21:19:40 -05:00
+++ edited/drivers/scsi/libata-core.c 2005-02-22 21:45:16 -05:00
@@ -377,7 +377,7 @@
}
/**
- * ata_check_status - Read device status reg & clear interrupt
+ * ata_check_status_pio - Read device status reg & clear interrupt
* @ap: port where the device is
*
* Reads ATA taskfile status register for currently-selected device
@@ -415,6 +415,27 @@
return ata_check_status_pio(ap);
}
+u8 ata_altstatus(struct ata_port *ap)
+{
+ if (ap->ops->check_altstatus)
+ return ap->ops->check_altstatus(ap);
+
+ if (ap->flags & ATA_FLAG_MMIO)
+ return readb((void __iomem *)ap->ioaddr.altstatus_addr);
+ return inb(ap->ioaddr.altstatus_addr);
+}
+
+u8 ata_chk_err(struct ata_port *ap)
+{
+ if (ap->ops->check_err)
+ return ap->ops->check_err(ap);
+
+ if (ap->flags & ATA_FLAG_MMIO) {
+ return readb((void __iomem *) ap->ioaddr.error_addr);
+ }
+ return inb(ap->ioaddr.error_addr);
+}
+
/**
* ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
* @tf: Taskfile to convert
@@ -1161,7 +1182,6 @@
printk(KERN_WARNING "ata%u: dev %u not supported, ignoring\n",
ap->id, device);
err_out:
- ata_irq_on(ap); /* re-enable interrupts */
dev->class++; /* converts ATA_DEV_xxx into ATA_DEV_xxx_UNSUP */
DPRINTK("EXIT, err\n");
}
@@ -1669,7 +1689,8 @@
ata_dev_try_classify(ap, 1);
/* re-enable interrupts */
- ata_irq_on(ap);
+ if (ap->ioaddr.ctl_addr) /* FIXME: hack. create a hook instead */
+ ata_irq_on(ap);
/* is double-select really necessary? */
if (ap->device[1].class != ATA_DEV_NONE)
@@ -3972,6 +3993,8 @@
EXPORT_SYMBOL_GPL(ata_tf_to_fis);
EXPORT_SYMBOL_GPL(ata_tf_from_fis);
EXPORT_SYMBOL_GPL(ata_check_status);
+EXPORT_SYMBOL_GPL(ata_altstatus);
+EXPORT_SYMBOL_GPL(ata_chk_err);
EXPORT_SYMBOL_GPL(ata_exec_command);
EXPORT_SYMBOL_GPL(ata_port_start);
EXPORT_SYMBOL_GPL(ata_port_stop);
===== include/linux/libata.h 1.64 vs edited =====
--- 1.64/include/linux/libata.h 2005-02-17 19:29:16 -05:00
+++ edited/include/linux/libata.h 2005-02-22 21:37:02 -05:00
@@ -334,6 +334,8 @@
void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
u8 (*check_status)(struct ata_port *ap);
+ u8 (*check_altstatus)(struct ata_port *ap);
+ u8 (*check_err)(struct ata_port *ap);
void (*dev_select)(struct ata_port *ap, unsigned int device);
void (*phy_reset) (struct ata_port *ap);
@@ -403,6 +405,8 @@
extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
extern u8 ata_check_status(struct ata_port *ap);
+extern u8 ata_altstatus(struct ata_port *ap);
+extern u8 ata_chk_err(struct ata_port *ap);
extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf);
extern int ata_port_start (struct ata_port *ap);
extern void ata_port_stop (struct ata_port *ap);
@@ -457,24 +461,9 @@
(dev->class == ATA_DEV_ATAPI));
}
-static inline u8 ata_chk_err(struct ata_port *ap)
-{
- if (ap->flags & ATA_FLAG_MMIO) {
- return readb((void __iomem *) ap->ioaddr.error_addr);
- }
- return inb(ap->ioaddr.error_addr);
-}
-
static inline u8 ata_chk_status(struct ata_port *ap)
{
return ap->ops->check_status(ap);
-}
-
-static inline u8 ata_altstatus(struct ata_port *ap)
-{
- if (ap->flags & ATA_FLAG_MMIO)
- return readb((void __iomem *)ap->ioaddr.altstatus_addr);
- return inb(ap->ioaddr.altstatus_addr);
}
static inline void ata_pause(struct ata_port *ap)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Re: AHCI oops
2005-02-23 2:48 ` [PATCH] Re: AHCI oops Jeff Garzik
@ 2005-02-23 15:56 ` Brett Russ
0 siblings, 0 replies; 2+ messages in thread
From: Brett Russ @ 2005-02-23 15:56 UTC (permalink / raw)
To: Jeff Garzik
Cc: Justin Cormack, linux-ide@vger.kernel.org, Linux Kernel,
Andrew Morton
Jeff Garzik wrote:
> Can you try this patch?
>
> If it fixes the oops, I'll forward upstream ASAP.
Jeff,
It fixes the oops (pasted below) for me; please do push it ASAP.
thanks,
BR
xlated vfy cmd LBA 0x14f500 cnt 20
ahci_interrupt: int on port 2
ahci_host_intr: fatal int seen
ahci_intr_error: port 2 irq_stat 0x40000001
struct ata_port *ap = 0xc1bf79bc
ap->ioaddr.error_addr = 0x00000000
Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
c0279bfd
*pde = 00000000
Oops: 0000 [#1]
Modules linked in: af_packet ipmi_devintf ipmi_msghandler
CPU: 0
EIP: 0060:[<c0279bfd>] Not tainted VLI
EFLAGS: 00010202 (2.6.11-rc4)
EIP is at ata_to_sense_error+0x22d/0x3a0
eax: 00000000 ebx: ffffffff ecx: 563ff726 edx: 000007bf
esi: c1bf79bc edi: c1bf08bc ebp: 00000000 esp: c03a5ed4
ds: 007b es: 007b ss: 0068
Process swapper (pid: 0, threadinfo=c03a4000 task=c0350b20)
Stack: c0329736 00000000 00000282 001f7934 c1bf0800 01000246 c1bf7e78
c1bf0800
c1bf7e78 40000001 c1bf7e78 c027a48e c1bf7e78 c1bf79bc c0277fd4
c0333e88
00000002 00000002 40000001 00000002 01bf79bc 00000002 c027baa2
c032995e
Call Trace:
[<c027a48e>] ata_scsi_qc_complete+0x5e/0x60
[<c0277fd4>] ata_qc_complete+0x34/0xf0
[<c027baa2>] ahci_interrupt+0x152/0x1a0
[<c012b082>] handle_IRQ_event+0x32/0x70
[<c012b167>] __do_IRQ+0xa7/0x110
[<c01044a6>] do_IRQ+0x36/0x70
[<c0102cf2>] common_interrupt+0x1a/0x20
[<c0100675>] mwait_idle+0x25/0x50
[<c0100609>] cpu_idle+0x49/0x60
[<c03a680a>] start_kernel+0x16a/0x1b0
[<c03a6380>] unknown_bootoption+0x0/0x1e0
Code: e9 ff 8d b6 00 00 00 00 8d bf 00 00 00 00 b8 58 89 41 00 4b e8 e5
e6 f7 f
<0>Kernel panic - not syncing: Fatal exception in interrupt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-02-23 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200502200256.j1K2uKJ23938@tench.street-vision.com>
2005-02-23 2:48 ` [PATCH] Re: AHCI oops Jeff Garzik
2005-02-23 15:56 ` Brett Russ
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).