···309309static void nv_nf2_thaw(struct ata_port *ap);310310static void nv_ck804_freeze(struct ata_port *ap);311311static void nv_ck804_thaw(struct ata_port *ap);312312+static int nv_hardreset(struct ata_link *link, unsigned int *class,313313+ unsigned long deadline);312314static int nv_adma_slave_config(struct scsi_device *sdev);313315static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc);314316static void nv_adma_qc_prep(struct ata_queued_cmd *qc);···405403 .slave_configure = nv_swncq_slave_config,406404};407405408408-static struct ata_port_operations nv_generic_ops = {406406+/* OSDL bz3352 reports that some nv controllers can't determine device407407+ * signature reliably and nv_hardreset is implemented to work around408408+ * the problem. This was reported on nf3 and it's unclear whether any409409+ * other controllers are affected. However, the workaround has been410410+ * applied to all variants and there isn't much to gain by trying to411411+ * find out exactly which ones are affected at this point especially412412+ * because NV has moved over to ahci for newer controllers.413413+ */414414+static struct ata_port_operations nv_common_ops = {409415 .inherits = &ata_bmdma_port_ops,410410- .hardreset = ATA_OP_NULL,416416+ .hardreset = nv_hardreset,411417 .scr_read = nv_scr_read,412418 .scr_write = nv_scr_write,413419};414420421421+/* OSDL bz11195 reports that link doesn't come online after hardreset422422+ * on generic nv's and there have been several other similar reports423423+ * on linux-ide. Disable hardreset for generic nv's.424424+ */425425+static struct ata_port_operations nv_generic_ops = {426426+ .inherits = &nv_common_ops,427427+ .hardreset = ATA_OP_NULL,428428+};429429+415430static struct ata_port_operations nv_nf2_ops = {416416- .inherits = &nv_generic_ops,431431+ .inherits = &nv_common_ops,417432 .freeze = nv_nf2_freeze,418433 .thaw = nv_nf2_thaw,419434};420435421436static struct ata_port_operations nv_ck804_ops = {422422- .inherits = &nv_generic_ops,437437+ .inherits = &nv_common_ops,423438 .freeze = nv_ck804_freeze,424439 .thaw = nv_ck804_thaw,425440 .host_stop = nv_ck804_host_stop,426441};427442428443static struct ata_port_operations nv_adma_ops = {429429- .inherits = &nv_generic_ops,444444+ .inherits = &nv_common_ops,430445431446 .check_atapi_dma = nv_adma_check_atapi_dma,432447 .sff_tf_read = nv_adma_tf_read,···467448};468449469450static struct ata_port_operations nv_swncq_ops = {470470- .inherits = &nv_generic_ops,451451+ .inherits = &nv_common_ops,471452472453 .qc_defer = ata_std_qc_defer,473454 .qc_prep = nv_swncq_qc_prep,···16031584 mask |= (NV_INT_MASK_MCP55 << shift);16041585 writel(mask, mmio_base + NV_INT_ENABLE_MCP55);16051586 ata_sff_thaw(ap);15871587+}15881588+15891589+static int nv_hardreset(struct ata_link *link, unsigned int *class,15901590+ unsigned long deadline)15911591+{15921592+ int rc;15931593+15941594+ /* SATA hardreset fails to retrieve proper device signature on15951595+ * some controllers. Request follow up SRST. For more info,15961596+ * see http://bugzilla.kernel.org/show_bug.cgi?id=335215971597+ */15981598+ rc = sata_sff_hardreset(link, class, deadline);15991599+ if (rc)16001600+ return rc;16011601+ return -EAGAIN;16061602}1607160316081604static void nv_adma_error_handler(struct ata_port *ap)