Commit 403dd7da authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Dan Williams
Browse files

crypto/ccp: Use PCI bridge defaults for IDE



The current number of streams in AMD TSM is 1 which is too little,
the core uses 255. Also, even if the module parameter is increased,
calling pci_ide_set_nr_streams() second time triggers WARN_ON.

Simplify the code by sticking to the PCI core defaults.

Fixes: 4be42357 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)")
Signed-off-by: default avatarAlexey Kardashevskiy <aik@amd.com>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Link: https://patch.msgid.link/20260123053057.1350569-2-aik@amd.com


Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 894148a2
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -19,12 +19,6 @@

MODULE_IMPORT_NS("PCI_IDE");

#define TIO_DEFAULT_NR_IDE_STREAMS	1

static uint nr_ide_streams = TIO_DEFAULT_NR_IDE_STREAMS;
module_param_named(ide_nr, nr_ide_streams, uint, 0644);
MODULE_PARM_DESC(ide_nr, "Set the maximum number of IDE streams per PHB");

#define dev_to_sp(dev)		((struct sp_device *)dev_get_drvdata(dev))
#define dev_to_psp(dev)		((struct psp_device *)(dev_to_sp(dev)->psp_data))
#define dev_to_sev(dev)		((struct sev_device *)(dev_to_psp(dev)->sev_data))
@@ -193,7 +187,6 @@ static void streams_teardown(struct pci_ide **ide)
static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide,
			unsigned int tc)
{
	struct pci_dev *rp = pcie_find_root_port(pdev);
	struct pci_ide *ide1;

	if (ide[tc]) {
@@ -201,11 +194,6 @@ static int stream_alloc(struct pci_dev *pdev, struct pci_ide **ide,
		return -EBUSY;
	}

	/* FIXME: find a better way */
	if (nr_ide_streams != TIO_DEFAULT_NR_IDE_STREAMS)
		pci_notice(pdev, "Enable non-default %d streams", nr_ide_streams);
	pci_ide_set_nr_streams(to_pci_host_bridge(rp->bus->bridge), nr_ide_streams);

	ide1 = pci_ide_stream_alloc(pdev);
	if (!ide1)
		return -EFAULT;