Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ata-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata

Pull ata fixes from Damien Le Moal:

- Fix link power management transitions to disallow unsupported states
(Niklas)

- A small string handling fix for the sata_mv driver (Christophe)

- Clear port pending interrupts before reset, as per AHCI
specifications (Szuying).

Followup fixes for this one are to not clear ATA_PFLAG_EH_PENDING in
ata_eh_reset() to allow EH to continue on with other actions recorded
with error interrupts triggered before EH completes. And an
additional fix to avoid thawing a port twice in EH (Niklas)

- Small code style fixes in the pata_parport driver to silence the
build bot as it keeps complaining about bad indentation (me)

- A fix for the recent CDL code to avoid fetching sense data for
successful commands when not necessary for correct operation (Niklas)

* tag 'ata-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
ata: libata-core: fetch sense data for successful commands iff CDL enabled
ata: libata-eh: do not thaw the port twice in ata_eh_reset()
ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset()
ata: pata_parport: Fix code style issues
ata: libahci: clear pending interrupt status
ata: sata_mv: Fix incorrect string length computation in mv_dump_mem()
ata: libata: disallow dev-initiated LPM transitions to unsupported states

+63 -40
+9
drivers/ata/ahci.c
··· 1883 1883 else 1884 1884 dev_info(&pdev->dev, "SSS flag set, parallel bus scan disabled\n"); 1885 1885 1886 + if (!(hpriv->cap & HOST_CAP_PART)) 1887 + host->flags |= ATA_HOST_NO_PART; 1888 + 1889 + if (!(hpriv->cap & HOST_CAP_SSC)) 1890 + host->flags |= ATA_HOST_NO_SSC; 1891 + 1892 + if (!(hpriv->cap2 & HOST_CAP2_SDS)) 1893 + host->flags |= ATA_HOST_NO_DEVSLP; 1894 + 1886 1895 if (pi.flags & ATA_FLAG_EM) 1887 1896 ahci_reset_em(host); 1888 1897
+23 -12
drivers/ata/libahci.c
··· 1256 1256 return sprintf(buf, "%d\n", emp->blink_policy); 1257 1257 } 1258 1258 1259 + static void ahci_port_clear_pending_irq(struct ata_port *ap) 1260 + { 1261 + struct ahci_host_priv *hpriv = ap->host->private_data; 1262 + void __iomem *port_mmio = ahci_port_base(ap); 1263 + u32 tmp; 1264 + 1265 + /* clear SError */ 1266 + tmp = readl(port_mmio + PORT_SCR_ERR); 1267 + dev_dbg(ap->host->dev, "PORT_SCR_ERR 0x%x\n", tmp); 1268 + writel(tmp, port_mmio + PORT_SCR_ERR); 1269 + 1270 + /* clear port IRQ */ 1271 + tmp = readl(port_mmio + PORT_IRQ_STAT); 1272 + dev_dbg(ap->host->dev, "PORT_IRQ_STAT 0x%x\n", tmp); 1273 + if (tmp) 1274 + writel(tmp, port_mmio + PORT_IRQ_STAT); 1275 + 1276 + writel(1 << ap->port_no, hpriv->mmio + HOST_IRQ_STAT); 1277 + } 1278 + 1259 1279 static void ahci_port_init(struct device *dev, struct ata_port *ap, 1260 1280 int port_no, void __iomem *mmio, 1261 1281 void __iomem *port_mmio) ··· 1290 1270 if (rc) 1291 1271 dev_warn(dev, "%s (%d)\n", emsg, rc); 1292 1272 1293 - /* clear SError */ 1294 - tmp = readl(port_mmio + PORT_SCR_ERR); 1295 - dev_dbg(dev, "PORT_SCR_ERR 0x%x\n", tmp); 1296 - writel(tmp, port_mmio + PORT_SCR_ERR); 1297 - 1298 - /* clear port IRQ */ 1299 - tmp = readl(port_mmio + PORT_IRQ_STAT); 1300 - dev_dbg(dev, "PORT_IRQ_STAT 0x%x\n", tmp); 1301 - if (tmp) 1302 - writel(tmp, port_mmio + PORT_IRQ_STAT); 1303 - 1304 - writel(1 << port_no, mmio + HOST_IRQ_STAT); 1273 + ahci_port_clear_pending_irq(ap); 1305 1274 1306 1275 /* mark esata ports */ 1307 1276 tmp = readl(port_mmio + PORT_CMD); ··· 1611 1602 ata_tf_init(link->device, &tf); 1612 1603 tf.status = ATA_BUSY; 1613 1604 ata_tf_to_fis(&tf, 0, 0, d2h_fis); 1605 + 1606 + ahci_port_clear_pending_irq(ap); 1614 1607 1615 1608 rc = sata_link_hardreset(link, timing, deadline, online, 1616 1609 ahci_check_ready);
+2 -5
drivers/ata/libata-core.c
··· 4783 4783 * been aborted by the device due to a limit timeout using the policy 4784 4784 * 0xD. For these commands, invoke EH to get the command sense data. 4785 4785 */ 4786 - if (qc->result_tf.status & ATA_SENSE && 4787 - ((ata_is_ncq(qc->tf.protocol) && 4788 - dev->flags & ATA_DFLAG_CDL_ENABLED) || 4789 - (!ata_is_ncq(qc->tf.protocol) && 4790 - ata_id_sense_reporting_enabled(dev->id)))) { 4786 + if (qc->flags & ATA_QCFLAG_HAS_CDL && 4787 + qc->result_tf.status & ATA_SENSE) { 4791 4788 /* 4792 4789 * Tell SCSI EH to not overwrite scmd->result even if this 4793 4790 * command is finished with result SAM_STAT_GOOD.
+3 -13
drivers/ata/libata-eh.c
··· 2796 2796 } 2797 2797 } 2798 2798 2799 - /* 2800 - * Some controllers can't be frozen very well and may set spurious 2801 - * error conditions during reset. Clear accumulated error 2802 - * information and re-thaw the port if frozen. As reset is the 2803 - * final recovery action and we cross check link onlineness against 2804 - * device classification later, no hotplug event is lost by this. 2805 - */ 2799 + /* clear cached SError */ 2806 2800 spin_lock_irqsave(link->ap->lock, flags); 2807 - memset(&link->eh_info, 0, sizeof(link->eh_info)); 2801 + link->eh_info.serror = 0; 2808 2802 if (slave) 2809 - memset(&slave->eh_info, 0, sizeof(link->eh_info)); 2810 - ap->pflags &= ~ATA_PFLAG_EH_PENDING; 2803 + slave->eh_info.serror = 0; 2811 2804 spin_unlock_irqrestore(link->ap->lock, flags); 2812 - 2813 - if (ata_port_is_frozen(ap)) 2814 - ata_eh_thaw_port(ap); 2815 2805 2816 2806 /* 2817 2807 * Make sure onlineness and classification result correspond.
+16 -3
drivers/ata/libata-sata.c
··· 396 396 case ATA_LPM_MED_POWER_WITH_DIPM: 397 397 case ATA_LPM_MIN_POWER_WITH_PARTIAL: 398 398 case ATA_LPM_MIN_POWER: 399 - if (ata_link_nr_enabled(link) > 0) 400 - /* no restrictions on LPM transitions */ 399 + if (ata_link_nr_enabled(link) > 0) { 400 + /* assume no restrictions on LPM transitions */ 401 401 scontrol &= ~(0x7 << 8); 402 - else { 402 + 403 + /* 404 + * If the controller does not support partial, slumber, 405 + * or devsleep, then disallow these transitions. 406 + */ 407 + if (link->ap->host->flags & ATA_HOST_NO_PART) 408 + scontrol |= (0x1 << 8); 409 + 410 + if (link->ap->host->flags & ATA_HOST_NO_SSC) 411 + scontrol |= (0x2 << 8); 412 + 413 + if (link->ap->host->flags & ATA_HOST_NO_DEVSLP) 414 + scontrol |= (0x4 << 8); 415 + } else { 403 416 /* empty port, power off */ 404 417 scontrol &= ~0xf; 405 418 scontrol |= (0x1 << 2);
+4 -5
drivers/ata/pata_parport/comm.c
··· 37 37 { 38 38 int l, h, r; 39 39 40 - r = regr + cont_map[cont]; 40 + r = regr + cont_map[cont]; 41 41 42 42 switch (pi->mode) { 43 43 case 0: ··· 90 90 } 91 91 92 92 static void comm_disconnect(struct pi_adapter *pi) 93 - 94 93 { 95 94 w2(0); w2(0); w2(0); w2(4); 96 95 w0(pi->saved_r0); ··· 171 172 w4l(swab16(((u16 *)buf)[2 * k]) | 172 173 swab16(((u16 *)buf)[2 * k + 1]) << 16); 173 174 break; 174 - } 175 + } 175 176 } 176 177 177 178 static void comm_log_adapter(struct pi_adapter *pi) 178 - 179 - { char *mode_string[5] = { "4-bit", "8-bit", "EPP-8", "EPP-16", "EPP-32" }; 179 + { 180 + char *mode_string[5] = { "4-bit", "8-bit", "EPP-8", "EPP-16", "EPP-32" }; 180 181 181 182 dev_info(&pi->dev, 182 183 "DataStor Commuter at 0x%x, mode %d (%s), delay %d\n",
+2 -2
drivers/ata/sata_mv.c
··· 1255 1255 1256 1256 for (b = 0; b < bytes; ) { 1257 1257 for (w = 0, o = 0; b < bytes && w < 4; w++) { 1258 - o += snprintf(linebuf + o, sizeof(linebuf) - o, 1259 - "%08x ", readl(start + b)); 1258 + o += scnprintf(linebuf + o, sizeof(linebuf) - o, 1259 + "%08x ", readl(start + b)); 1260 1260 b += sizeof(u32); 1261 1261 } 1262 1262 dev_dbg(dev, "%s: %p: %s\n",
+4
include/linux/libata.h
··· 222 222 ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ 223 223 ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */ 224 224 225 + ATA_HOST_NO_PART = (1 << 4), /* Host does not support partial */ 226 + ATA_HOST_NO_SSC = (1 << 5), /* Host does not support slumber */ 227 + ATA_HOST_NO_DEVSLP = (1 << 6), /* Host does not support devslp */ 228 + 225 229 /* bits 24:31 of host->flags are reserved for LLD specific flags */ 226 230 227 231 /* various lengths of time */