Skip to content

Commit 0519359

Browse files
committed
Merge branch 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata updates from Tejun Heo: "Nothing too interesting. Mostly ahci and ahci_platform changes, many around power management" * 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits) ata: ahci_platform: enable to get and control reset ata: libahci_platform: add reset control support ata: add an extra argument to ahci_platform_get_resources() ata: sata_rcar: Add r8a77965 support ata: sata_rcar: exclude setting of PHY registers in Gen3 ata: sata_rcar: really mask all interrupts on Gen2 and later Revert "ata: ahci_platform: allow disabling of hotplug to save power" ata: libahci: Allow reconfigure of DEVSLP register ata: libahci: Correct setting of DEVSLP register ata: ahci: Enable DEVSLP by default on x86 with SLP_S0 ata: ahci: Support state with min power but Partial low power state Revert "ata: ahci_platform: convert kcalloc to devm_kcalloc" ata: sata_rcar: Add rudimentary Runtime PM support ata: sata_rcar: Provide a short-hand for &pdev->dev ata: Only output sg element mapped number in verbose debug ata: Guard ata_scsi_dump_cdb() by ATA_VERBOSE_DEBUG ata: ahci_platform: convert kcalloc to devm_kcalloc ata: ahci_platform: convert kzallloc to kcalloc ata: ahci_platform: correct parameter documentation for ahci_platform_shutdown libata: remove ata_sff_data_xfer_noirq() ...
2 parents 5967661 + 2d17f46 commit 0519359

35 files changed

+166
-126
lines changed

Documentation/devicetree/bindings/ata/ahci-platform.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ compatible:
2929
Optional properties:
3030
- dma-coherent : Present if dma operations are coherent
3131
- clocks : a list of phandle + clock specifier pairs
32+
- resets : a list of phandle + reset specifier pairs
3233
- target-supply : regulator for SATA target power
3334
- phys : reference to the SATA PHY node
3435
- phy-names : must be "sata-phy"

Documentation/devicetree/bindings/ata/sata_rcar.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
- "renesas,sata-r8a7791" for R-Car M2-W
99
- "renesas,sata-r8a7793" for R-Car M2-N
1010
- "renesas,sata-r8a7795" for R-Car H3
11+
- "renesas,sata-r8a77965" for R-Car M3-N
1112
- "renesas,rcar-gen2-sata" for a generic R-Car Gen2 compatible device
1213
- "renesas,rcar-gen3-sata" for a generic R-Car Gen3 compatible device
1314
- "renesas,rcar-sata" is deprecated

Documentation/driver-api/libata.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ PIO data read/write
118118
All bmdma-style drivers must implement this hook. This is the low-level
119119
operation that actually copies the data bytes during a PIO data
120120
transfer. Typically the driver will choose one of
121-
:c:func:`ata_sff_data_xfer_noirq`, :c:func:`ata_sff_data_xfer`, or
122-
:c:func:`ata_sff_data_xfer32`.
121+
:c:func:`ata_sff_data_xfer`, or :c:func:`ata_sff_data_xfer32`.
123122

124123
ATA command execute
125124
~~~~~~~~~~~~~~~~~~~

drivers/ata/ahci.c

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ static int marvell_enable = 1;
610610
module_param(marvell_enable, int, 0644);
611611
MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");
612612

613-
static int mobile_lpm_policy = CONFIG_SATA_MOBILE_LPM_POLICY;
613+
static int mobile_lpm_policy = -1;
614614
module_param(mobile_lpm_policy, int, 0644);
615615
MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
616616

@@ -1604,6 +1604,37 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
16041604
return pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
16051605
}
16061606

1607+
static void ahci_update_initial_lpm_policy(struct ata_port *ap,
1608+
struct ahci_host_priv *hpriv)
1609+
{
1610+
int policy = CONFIG_SATA_MOBILE_LPM_POLICY;
1611+
1612+
1613+
/* Ignore processing for non mobile platforms */
1614+
if (!(hpriv->flags & AHCI_HFLAG_IS_MOBILE))
1615+
return;
1616+
1617+
/* user modified policy via module param */
1618+
if (mobile_lpm_policy != -1) {
1619+
policy = mobile_lpm_policy;
1620+
goto update_policy;
1621+
}
1622+
1623+
#ifdef CONFIG_ACPI
1624+
if (policy > ATA_LPM_MED_POWER &&
1625+
(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
1626+
if (hpriv->cap & HOST_CAP_PART)
1627+
policy = ATA_LPM_MIN_POWER_WITH_PARTIAL;
1628+
else if (hpriv->cap & HOST_CAP_SSC)
1629+
policy = ATA_LPM_MIN_POWER;
1630+
}
1631+
#endif
1632+
1633+
update_policy:
1634+
if (policy >= ATA_LPM_UNKNOWN && policy <= ATA_LPM_MIN_POWER)
1635+
ap->target_lpm_policy = policy;
1636+
}
1637+
16071638
static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
16081639
{
16091640
unsigned int board_id = ent->driver_data;
@@ -1807,10 +1838,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
18071838
if (ap->flags & ATA_FLAG_EM)
18081839
ap->em_message_type = hpriv->em_msg_type;
18091840

1810-
if ((hpriv->flags & AHCI_HFLAG_IS_MOBILE) &&
1811-
mobile_lpm_policy >= ATA_LPM_UNKNOWN &&
1812-
mobile_lpm_policy <= ATA_LPM_MIN_POWER)
1813-
ap->target_lpm_policy = mobile_lpm_policy;
1841+
ahci_update_initial_lpm_policy(ap, hpriv);
18141842

18151843
/* disabled/not-implemented port */
18161844
if (!(hpriv->port_map & (1 << i)))

drivers/ata/ahci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ struct ahci_host_priv {
350350
u32 em_msg_type; /* EM message type */
351351
bool got_runtime_pm; /* Did we do pm_runtime_get? */
352352
struct clk *clks[AHCI_MAX_CLKS]; /* Optional */
353+
struct reset_control *rsts; /* Optional */
353354
struct regulator **target_pwrs; /* Optional */
354355
/*
355356
* If platform uses PHYs. There is a 1:1 relation between the port number and

drivers/ata/ahci_brcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static int brcm_ahci_probe(struct platform_device *pdev)
425425

426426
brcm_sata_phys_enable(priv);
427427

428-
hpriv = ahci_platform_get_resources(pdev);
428+
hpriv = ahci_platform_get_resources(pdev, 0);
429429
if (IS_ERR(hpriv))
430430
return PTR_ERR(hpriv);
431431
hpriv->plat_data = priv;

drivers/ata/ahci_ceva.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int ceva_ahci_probe(struct platform_device *pdev)
213213

214214
cevapriv->ahci_pdev = pdev;
215215

216-
hpriv = ahci_platform_get_resources(pdev);
216+
hpriv = ahci_platform_get_resources(pdev, 0);
217217
if (IS_ERR(hpriv))
218218
return PTR_ERR(hpriv);
219219

drivers/ata/ahci_da850.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static int ahci_da850_probe(struct platform_device *pdev)
171171
u32 mpy;
172172
int rc;
173173

174-
hpriv = ahci_platform_get_resources(pdev);
174+
hpriv = ahci_platform_get_resources(pdev, 0);
175175
if (IS_ERR(hpriv))
176176
return PTR_ERR(hpriv);
177177

drivers/ata/ahci_dm816.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static int ahci_dm816_probe(struct platform_device *pdev)
148148
struct ahci_host_priv *hpriv;
149149
int rc;
150150

151-
hpriv = ahci_platform_get_resources(pdev);
151+
hpriv = ahci_platform_get_resources(pdev, 0);
152152
if (IS_ERR(hpriv))
153153
return PTR_ERR(hpriv);
154154

drivers/ata/ahci_imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ static int imx_ahci_probe(struct platform_device *pdev)
11271127
return ret;
11281128
}
11291129

1130-
hpriv = ahci_platform_get_resources(pdev);
1130+
hpriv = ahci_platform_get_resources(pdev, 0);
11311131
if (IS_ERR(hpriv))
11321132
return PTR_ERR(hpriv);
11331133

0 commit comments

Comments
 (0)