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 159561 Details for
Bug 204969
hal polls storage devices
[?]
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]
combined patches
linux-2.6.23-0.29.rc0.git6.fc8-sata-an.patch (text/plain), 15.16 KB, created by
David Zeuthen
on 2007-07-18 21:38:58 UTC
(
hide
)
Description:
combined patches
Filename:
MIME Type:
Creator:
David Zeuthen
Created:
2007-07-18 21:38:58 UTC
Size:
15.16 KB
patch
obsolete
>--- linux-2.6.22.i386/drivers/ata/libata-core.c 2007-07-18 17:24:00.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/ata/libata-core.c 2007-07-18 16:07:50.000000000 -0400 >@@ -70,6 +70,7 @@ > static unsigned int ata_dev_init_params(struct ata_device *dev, > u16 heads, u16 sectors); > static unsigned int ata_dev_set_xfermode(struct ata_device *dev); >+static unsigned int ata_dev_set_AN(struct ata_device *dev); > static void ata_dev_xfermask(struct ata_device *dev); > static unsigned long ata_dev_blacklisted(const struct ata_device *dev); > >@@ -1972,6 +1973,22 @@ > } > dev->cdb_len = (unsigned int) rc; > >+ /* >+ * check to see if this ATAPI device supports >+ * Asynchronous Notification >+ */ >+ if ((ap->flags & ATA_FLAG_AN) && ata_id_has_AN(id)) { >+ int err; >+ /* issue SET feature command to turn this on */ >+ err = ata_dev_set_AN(dev); >+ if (err) >+ ata_dev_printk(dev, KERN_ERR, >+ "unable to set AN, err %x\n", >+ err); >+ else >+ dev->flags |= ATA_DFLAG_AN; >+ } >+ > if (ata_id_cdb_intr(dev->id)) { > dev->flags |= ATA_DFLAG_CDB_INTR; > cdb_intr_string = ", CDB intr"; >@@ -3928,6 +3945,41 @@ > } > > /** >+ * ata_dev_set_AN - Issue SET FEATURES - SATA FEATURES >+ * @dev: Device to which command will be sent >+ * >+ * Issue SET FEATURES - SATA FEATURES command to device @dev >+ * on port @ap with sector count set to indicate Asynchronous >+ * Notification feature >+ * >+ * LOCKING: >+ * PCI/etc. bus probe sem. >+ * >+ * RETURNS: >+ * 0 on success, AC_ERR_* mask otherwise. >+ */ >+static unsigned int ata_dev_set_AN(struct ata_device *dev) >+{ >+ struct ata_taskfile tf; >+ unsigned int err_mask; >+ >+ /* set up set-features taskfile */ >+ DPRINTK("set features - SATA features\n"); >+ >+ ata_tf_init(dev, &tf); >+ tf.command = ATA_CMD_SET_FEATURES; >+ tf.feature = SETFEATURES_SATA_ENABLE; >+ tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; >+ tf.protocol = ATA_PROT_NODATA; >+ tf.nsect = SATA_AN; >+ >+ err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); >+ >+ DPRINTK("EXIT, err_mask=%x\n", err_mask); >+ return err_mask; >+} >+ >+/** > * ata_dev_init_params - Issue INIT DEV PARAMS command > * @dev: Device to which command will be sent > * @heads: Number of heads (taskfile parameter) >--- linux-2.6.22.i386/include/linux/ata.h 2007-07-18 17:24:01.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/include/linux/ata.h 2007-07-18 16:07:50.000000000 -0400 >@@ -208,6 +208,12 @@ > > SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ > >+ SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ >+ SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */ >+ >+ /* SETFEATURE Sector counts for SATA features */ >+ SATA_AN = 0x05, /* Asynchronous Notification */ >+ > /* ATAPI stuff */ > ATAPI_PKT_DMA = (1 << 0), > ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: >@@ -335,6 +341,9 @@ > #define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) > #define ata_id_removeable(id) ((id)[0] & (1 << 7)) > #define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) >+#define ata_id_has_AN(id) \ >+ ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ >+ ((id)[78] & (1 << 5)) ) > #define ata_id_iordy_disable(id) ((id)[49] & (1 << 10)) > #define ata_id_has_iordy(id) ((id)[49] & (1 << 9)) > #define ata_id_u32(id,n) \ >--- linux-2.6.22.i386/include/linux/libata.h 2007-07-18 17:24:02.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/include/linux/libata.h 2007-07-18 16:10:49.000000000 -0400 >@@ -139,6 +139,7 @@ > ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ > ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */ > ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */ >+ ATA_DFLAG_AN = (1 << 7), /* device supports Async notification */ > ATA_DFLAG_CFG_MASK = (1 << 8) - 1, > > ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ >@@ -177,6 +178,7 @@ > ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ > ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ > ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ >+ ATA_FLAG_AN = (1 << 18), /* controller supports AN */ > > /* The following flag belongs to ap->pflags but is kept in > * ap->flags because it's referenced in many LLDs and will be >@@ -728,6 +730,7 @@ > extern int ata_scsi_detect(struct scsi_host_template *sht); > extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); > extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); >+extern void ata_scsi_media_change_notify(struct ata_device *atadev); > extern void ata_sas_port_destroy(struct ata_port *); > extern struct ata_port *ata_sas_port_alloc(struct ata_host *, > struct ata_port_info *, struct Scsi_Host *); >--- linux-2.6.22.i386/drivers/ata/ahci.c 2007-07-18 17:24:03.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/ata/ahci.c 2007-07-18 16:10:49.000000000 -0400 >@@ -331,14 +331,15 @@ > static const struct ata_port_info ahci_port_info[] = { > /* board_ahci */ > { >- .flags = AHCI_FLAG_COMMON, >+ .flags = AHCI_FLAG_COMMON | ATA_FLAG_AN, > .pio_mask = 0x1f, /* pio0-4 */ > .udma_mask = ATA_UDMA6, > .port_ops = &ahci_ops, > }, > /* board_ahci_pi */ > { >- .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI, >+ .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI | >+ ATA_FLAG_AN, > .pio_mask = 0x1f, /* pio0-4 */ > .udma_mask = ATA_UDMA6, > .port_ops = &ahci_ops, >@@ -417,10 +418,7 @@ > > /* ATI */ > { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */ >- { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700 IDE */ >- { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb600 }, /* ATI SB700 AHCI */ >- { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb600 }, /* ATI SB700 nor-raid5 */ >- { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb600 }, /* ATI SB700 raid5 */ >+ { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700 */ > > /* VIA */ > { PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */ >@@ -1315,6 +1313,28 @@ > return; > } > >+ if (status & PORT_IRQ_SDB_FIS) { >+ /* >+ * if this is an ATAPI device with AN turned on, >+ * then we should interrogate the device to >+ * determine the cause of the interrupt >+ * >+ * for AN - this we should check the SDB FIS >+ * and find the I and N bits set >+ */ >+ const u32 *f = pp->rx_fis + RX_FIS_SDB; >+ >+ /* check the 'N' bit in word 0 of the FIS */ >+ if (f[0] & (1 << 15)) { >+ int port_addr = ((f[0] & 0x00000f00) >> 8); >+ struct ata_device *adev; >+ if (port_addr < ATA_MAX_DEVICES) { >+ adev = &ap->device[port_addr]; >+ if (adev->flags & ATA_DFLAG_AN) >+ ata_scsi_media_change_notify(adev); >+ } >+ } >+ } > if (ap->sactive) > qc_active = readl(port_mmio + PORT_SCR_ACT); > else >--- linux-2.6.22.i386/drivers/scsi/sr.c 2007-07-18 17:24:01.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/scsi/sr.c 2007-07-18 16:10:41.000000000 -0400 >@@ -603,7 +603,10 @@ > > dev_set_drvdata(dev, cd); > disk->flags |= GENHD_FL_REMOVABLE; >+ if (sdev->media_change_notify) >+ disk->flags |= GENHD_FL_MEDIA_CHANGE_NOTIFY; > add_disk(disk); >+ sdev->disk = disk; > > sdev_printk(KERN_DEBUG, sdev, > "Attached scsi CD-ROM %s\n", cd->cdi.name); >--- linux-2.6.22.i386/include/scsi/scsi_device.h 2007-07-18 17:24:02.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/include/scsi/scsi_device.h 2007-07-18 16:10:41.000000000 -0400 >@@ -126,7 +126,7 @@ > unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ > unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ > unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ >- >+ unsigned media_change_notify:1; /* dev supports async media notify */ > unsigned int device_blocked; /* Device returned QUEUE_FULL. */ > > unsigned int max_device_blocked; /* what device_blocked counts down from */ >@@ -140,7 +140,7 @@ > > struct device sdev_gendev; > struct class_device sdev_classdev; >- >+ struct gendisk *disk; > struct execute_work ew; /* used to get process context on put */ > > enum scsi_device_state sdev_state; >--- linux-2.6.22.i386/drivers/scsi/sd.c 2007-07-18 17:24:01.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/scsi/sd.c 2007-07-18 16:10:41.000000000 -0400 >@@ -1668,8 +1668,12 @@ > if (sdp->removable) > gd->flags |= GENHD_FL_REMOVABLE; > >+ if (sdp->media_change_notify) >+ gd->flags |= GENHD_FL_MEDIA_CHANGE_NOTIFY; >+ > dev_set_drvdata(dev, sdkp); > add_disk(gd); >+ sdp->disk = gd; > > sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", > sdp->removable ? "removable " : ""); >--- linux-2.6.22.i386/drivers/ata/libata-scsi.c 2007-07-18 17:24:00.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/ata/libata-scsi.c 2007-07-18 16:10:49.000000000 -0400 >@@ -772,6 +772,9 @@ > blk_queue_max_hw_segments(q, q->max_hw_segments - 1); > } > >+ if (dev->flags & ATA_DFLAG_AN) >+ sdev->media_change_notify = 1; >+ > if (dev->flags & ATA_DFLAG_NCQ) { > int depth; > >@@ -3053,6 +3056,22 @@ > } > > /** >+ * ata_scsi_media_change_notify - send media change event >+ * @atadev: Pointer to the disk device with media change event >+ * >+ * Tell the block layer to send a media change notification >+ * event. >+ * >+ * LOCKING: >+ * interrupt context, may not sleep. >+ */ >+void ata_scsi_media_change_notify(struct ata_device *atadev) >+{ >+ genhd_media_change_notify(atadev->sdev->disk); >+} >+EXPORT_SYMBOL_GPL(ata_scsi_media_change_notify); >+ >+/** > * ata_scsi_hotplug - SCSI part of hotplug > * @work: Pointer to ATA port to perform SCSI hotplug on > * >--- linux-2.6.22.i386/drivers/scsi/sd.c 2007-07-18 17:24:01.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/scsi/sd.c 2007-07-18 16:10:41.000000000 -0400 >@@ -1668,8 +1668,12 @@ > if (sdp->removable) > gd->flags |= GENHD_FL_REMOVABLE; > >+ if (sdp->media_change_notify) >+ gd->flags |= GENHD_FL_MEDIA_CHANGE_NOTIFY; >+ > dev_set_drvdata(dev, sdkp); > add_disk(gd); >+ sdp->disk = gd; > > sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", > sdp->removable ? "removable " : ""); >--- linux-2.6.22.i386/drivers/scsi/sr.c 2007-07-18 17:24:01.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/scsi/sr.c 2007-07-18 16:10:41.000000000 -0400 >@@ -603,7 +603,10 @@ > > dev_set_drvdata(dev, cd); > disk->flags |= GENHD_FL_REMOVABLE; >+ if (sdev->media_change_notify) >+ disk->flags |= GENHD_FL_MEDIA_CHANGE_NOTIFY; > add_disk(disk); >+ sdev->disk = disk; > > sdev_printk(KERN_DEBUG, sdev, > "Attached scsi CD-ROM %s\n", cd->cdi.name); >--- linux-2.6.22.i386/include/scsi/scsi_device.h 2007-07-18 17:24:02.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/include/scsi/scsi_device.h 2007-07-18 16:10:41.000000000 -0400 >@@ -126,7 +126,7 @@ > unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ > unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ > unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ >- >+ unsigned media_change_notify:1; /* dev supports async media notify */ > unsigned int device_blocked; /* Device returned QUEUE_FULL. */ > > unsigned int max_device_blocked; /* what device_blocked counts down from */ >@@ -140,7 +140,7 @@ > > struct device sdev_gendev; > struct class_device sdev_classdev; >- >+ struct gendisk *disk; > struct execute_work ew; /* used to get process context on put */ > > enum scsi_device_state sdev_state; >--- linux-2.6.22.i386/drivers/ata/ahci.c 2007-07-18 17:24:03.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/ata/ahci.c 2007-07-18 16:10:49.000000000 -0400 >@@ -331,14 +331,15 @@ > static const struct ata_port_info ahci_port_info[] = { > /* board_ahci */ > { >- .flags = AHCI_FLAG_COMMON, >+ .flags = AHCI_FLAG_COMMON | ATA_FLAG_AN, > .pio_mask = 0x1f, /* pio0-4 */ > .udma_mask = ATA_UDMA6, > .port_ops = &ahci_ops, > }, > /* board_ahci_pi */ > { >- .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI, >+ .flags = AHCI_FLAG_COMMON | AHCI_FLAG_HONOR_PI | >+ ATA_FLAG_AN, > .pio_mask = 0x1f, /* pio0-4 */ > .udma_mask = ATA_UDMA6, > .port_ops = &ahci_ops, >@@ -417,10 +418,7 @@ > > /* ATI */ > { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */ >- { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700 IDE */ >- { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb600 }, /* ATI SB700 AHCI */ >- { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb600 }, /* ATI SB700 nor-raid5 */ >- { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb600 }, /* ATI SB700 raid5 */ >+ { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700 */ > > /* VIA */ > { PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */ >@@ -1315,6 +1313,28 @@ > return; > } > >+ if (status & PORT_IRQ_SDB_FIS) { >+ /* >+ * if this is an ATAPI device with AN turned on, >+ * then we should interrogate the device to >+ * determine the cause of the interrupt >+ * >+ * for AN - this we should check the SDB FIS >+ * and find the I and N bits set >+ */ >+ const u32 *f = pp->rx_fis + RX_FIS_SDB; >+ >+ /* check the 'N' bit in word 0 of the FIS */ >+ if (f[0] & (1 << 15)) { >+ int port_addr = ((f[0] & 0x00000f00) >> 8); >+ struct ata_device *adev; >+ if (port_addr < ATA_MAX_DEVICES) { >+ adev = &ap->device[port_addr]; >+ if (adev->flags & ATA_DFLAG_AN) >+ ata_scsi_media_change_notify(adev); >+ } >+ } >+ } > if (ap->sactive) > qc_active = readl(port_mmio + PORT_SCR_ACT); > else >--- linux-2.6.22.i386/include/linux/libata.h 2007-07-18 17:24:02.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/include/linux/libata.h 2007-07-18 16:10:49.000000000 -0400 >@@ -139,6 +139,7 @@ > ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ > ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */ > ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */ >+ ATA_DFLAG_AN = (1 << 7), /* device supports Async notification */ > ATA_DFLAG_CFG_MASK = (1 << 8) - 1, > > ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ >@@ -177,6 +178,7 @@ > ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ > ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ > ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ >+ ATA_FLAG_AN = (1 << 18), /* controller supports AN */ > > /* The following flag belongs to ap->pflags but is kept in > * ap->flags because it's referenced in many LLDs and will be >@@ -728,6 +730,7 @@ > extern int ata_scsi_detect(struct scsi_host_template *sht); > extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); > extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); >+extern void ata_scsi_media_change_notify(struct ata_device *atadev); > extern void ata_sas_port_destroy(struct ata_port *); > extern struct ata_port *ata_sas_port_alloc(struct ata_host *, > struct ata_port_info *, struct Scsi_Host *); >--- linux-2.6.22.i386/drivers/ata/libata-scsi.c 2007-07-18 17:24:00.000000000 -0400 >+++ linux-2.6.22.i686.sata-an/drivers/ata/libata-scsi.c 2007-07-18 16:10:49.000000000 -0400 >@@ -772,6 +772,9 @@ > blk_queue_max_hw_segments(q, q->max_hw_segments - 1); > } > >+ if (dev->flags & ATA_DFLAG_AN) >+ sdev->media_change_notify = 1; >+ > if (dev->flags & ATA_DFLAG_NCQ) { > int depth; > >@@ -3053,6 +3056,22 @@ > } > > /** >+ * ata_scsi_media_change_notify - send media change event >+ * @atadev: Pointer to the disk device with media change event >+ * >+ * Tell the block layer to send a media change notification >+ * event. >+ * >+ * LOCKING: >+ * interrupt context, may not sleep. >+ */ >+void ata_scsi_media_change_notify(struct ata_device *atadev) >+{ >+ genhd_media_change_notify(atadev->sdev->disk); >+} >+EXPORT_SYMBOL_GPL(ata_scsi_media_change_notify); >+ >+/** > * ata_scsi_hotplug - SCSI part of hotplug > * @work: Pointer to ATA port to perform SCSI hotplug on > *
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 204969
:
135426
| 159561