Commit 22093997 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ata updates from Niklas Cassel:

 - Add 'external' to the libata.force module parameter, in order to
   allow a user to workaround broken firmware (me)

 - Use the str_up_down() helper in the sata_via driver (Salah Triki)

 - Convert the Freescale PowerQUICC SATA device tree binding to YAML
   (J. Neuschäfer)

 - Do not use ATAPI DMA for a device that only supports PIO (me)

 - Add Marvell 88SE9215 PCI device ID to the ahci driver. Since the
   controller has quirks, it cannot rely on the generic AHCI PCI class
   code entry (Daniel Kral)

 - Improve the return value of atapi_check_dma() (Huacai Chen)

 - Fix the NCQ Non-Data log not supported print to actually reference
   the correct log (me)

 - Make Marvel 88SE9215 prefer DMA for ATAPI devices (Huacai Chen)

 - Simplify the AHCI IRQ vector allocations by performing the IRQ vector
   allocations in the same function, regardless of IRQ type (Tomas
   Henzl)

* tag 'ata-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
  ata: ahci: simplify init function
  ahci: Marvell 88SE9215 controllers prefer DMA for ATAPI
  ata: libata: Fix NCQ Non-Data log not supported print
  ata: libata: Improve return value of atapi_check_dma()
  ahci: add PCI ID for Marvell 88SE9215 SATA Controller
  ata: libata-eh: Do not use ATAPI DMA for a device limited to PIO mode
  dt-bindings: ata: Convert fsl,pq-sata to YAML
  ata: sata_via: Use str_up_down() helper in vt6420_prereset()
  ata: libata-core: Add 'external' to the libata.force kernel parameter
parents 9b960d8c 565d065a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3117,6 +3117,8 @@
			* max_sec_lba48: Set or clear transfer size limit to
			  65535 sectors.

			* external: Mark port as external (hotplug-capable).

			* [no]lpm: Enable or disable link power management.

			* [no]setxfer: Indicate if transfer speed mode setting
+60 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/ata/fsl,pq-sata.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale 8xxx/3.0 Gb/s SATA nodes

maintainers:
  - J. Neuschäfer <j.ne@posteo.net>

description:
  SATA nodes are defined to describe on-chip Serial ATA controllers.
  Each SATA controller should have its own node.

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - fsl,mpc8377-sata
              - fsl,mpc8536-sata
              - fsl,mpc8315-sata
              - fsl,mpc8379-sata
          - const: fsl,pq-sata
      - const: fsl,pq-sata-v2

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  cell-index:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [1, 2, 3, 4]
    description: |
      1 for controller @ 0x18000
      2 for controller @ 0x19000
      3 for controller @ 0x1a000
      4 for controller @ 0x1b000

required:
  - compatible
  - interrupts
  - cell-index

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    sata@18000 {
        compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
        reg = <0x18000 0x1000>;
        cell-index = <1>;
        interrupts = <44 IRQ_TYPE_LEVEL_LOW>;
    };

...
+0 −28
Original line number Diff line number Diff line
* Freescale 8xxx/3.0 Gb/s SATA nodes

SATA nodes are defined to describe on-chip Serial ATA controllers.
Each SATA port should have its own node.

Required properties:
- compatible        : compatible list, contains 2 entries, first is
		 "fsl,CHIP-sata", where CHIP is the processor
		 (mpc8315, mpc8379, etc.) and the second is
		 "fsl,pq-sata"
- interrupts        : <interrupt mapping for SATA IRQ>
- cell-index        : controller index.
                          1 for controller @ 0x18000
                          2 for controller @ 0x19000
                          3 for controller @ 0x1a000
                          4 for controller @ 0x1b000

Optional properties:
- reg               : <registers mapping>

Example:
	sata@18000 {
		compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
		reg = <0x18000 0x1000>;
		cell-index = <1>;
		interrupts = <2c 8>;
		interrupt-parent = < &ipic >;
	};
+23 −11
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ enum board_ids {
	board_ahci_pcs_quirk_no_devslp,
	board_ahci_pcs_quirk_no_sntf,
	board_ahci_yes_fbs,
	board_ahci_yes_fbs_atapi_dma,

	/* board IDs for specific chipsets in alphabetical order */
	board_ahci_al,
@@ -188,6 +189,14 @@ static const struct ata_port_info ahci_port_info[] = {
		.udma_mask	= ATA_UDMA6,
		.port_ops	= &ahci_ops,
	},
	[board_ahci_yes_fbs_atapi_dma] = {
		AHCI_HFLAGS	(AHCI_HFLAG_YES_FBS |
				 AHCI_HFLAG_ATAPI_DMA_QUIRK),
		.flags		= AHCI_FLAG_COMMON,
		.pio_mask	= ATA_PIO4,
		.udma_mask	= ATA_UDMA6,
		.port_ops	= &ahci_ops,
	},
	/* by chipsets */
	[board_ahci_al] = {
		AHCI_HFLAGS	(AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_MSI),
@@ -589,6 +598,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
	  .driver_data = board_ahci_yes_fbs },
	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3),
	  .driver_data = board_ahci_yes_fbs },
	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9215),
	  .driver_data = board_ahci_yes_fbs_atapi_dma },
	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9230),
	  .driver_data = board_ahci_yes_fbs },
	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9235),
@@ -1665,13 +1676,15 @@ static int ahci_get_irq_vector(struct ata_host *host, int port)
	return pci_irq_vector(to_pci_dev(host->dev), port);
}

static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
static void ahci_init_irq(struct pci_dev *pdev, unsigned int n_ports,
			struct ahci_host_priv *hpriv)
{
	int nvec;

	if (hpriv->flags & AHCI_HFLAG_NO_MSI)
		return -ENODEV;
	if (hpriv->flags & AHCI_HFLAG_NO_MSI) {
		pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_INTX);
		return;
	}

	/*
	 * If number of MSIs is less than number of ports then Sharing Last
@@ -1685,7 +1698,7 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
			if (!(readl(hpriv->mmio + HOST_CTL) & HOST_MRSM)) {
				hpriv->get_irq_vector = ahci_get_irq_vector;
				hpriv->flags |= AHCI_HFLAG_MULTI_MSI;
				return nvec;
				return;
			}

			/*
@@ -1700,12 +1713,13 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,

	/*
	 * If the host is not capable of supporting per-port vectors, fall
	 * back to single MSI before finally attempting single MSI-X.
	 * back to single MSI before finally attempting single MSI-X or
	 * a legacy INTx.
	 */
	nvec = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
	if (nvec == 1)
		return nvec;
	return pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX);
		return;
	pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX | PCI_IRQ_INTX);
}

static void ahci_mark_external_port(struct ata_port *ap)
@@ -1985,10 +1999,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
	}
	host->private_data = hpriv;

	if (ahci_init_msi(pdev, n_ports, hpriv) < 0) {
		/* legacy intx interrupts */
		pcim_intx(pdev, 1);
	}
	ahci_init_irq(pdev, n_ports, hpriv);

	hpriv->irq = pci_irq_vector(pdev, 0);

	if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
+1 −0
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ enum {
	AHCI_HFLAG_NO_SXS		= BIT(26), /* SXS not supported */
	AHCI_HFLAG_43BIT_ONLY		= BIT(27), /* 43bit DMA addr limit */
	AHCI_HFLAG_INTEL_PCS_QUIRK	= BIT(28), /* apply Intel PCS quirk */
	AHCI_HFLAG_ATAPI_DMA_QUIRK	= BIT(29), /* force ATAPI to use DMA */

	/* ap->flags bits */

Loading