From: Shawn Lin Date: Tue, 6 Jan 2026 02:16:58 +0000 (+0800) Subject: mmc: dw_mmc: Remove fifo_depth from struct dw_mci_board X-Git-Tag: v7.1-rc1~157^2~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc1f8aacc9941150be504048a46dd94c111717bc;p=thirdparty%2Fkernel%2Fstable.git mmc: dw_mmc: Remove fifo_depth from struct dw_mci_board struct dw_mci already keeps one, so remove it from struct dw_mci_board. Now, as dw_mmc-pci still provide struct dw_mci_board, so host->fifo_depth will not be overwritten. Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c index 24f4036937115..89ad4993e4e19 100644 --- a/drivers/mmc/host/dw_mmc-pci.c +++ b/drivers/mmc/host/dw_mmc-pci.c @@ -28,7 +28,6 @@ static struct dw_mci_board pci_board_data = { .caps = DW_MCI_CAPABILITIES, .bus_hz = 33 * 1000 * 1000, .detect_delay_ms = 200, - .fifo_depth = 32, }; static int dw_mci_pci_probe(struct pci_dev *pdev, @@ -48,6 +47,7 @@ static int dw_mci_pci_probe(struct pci_dev *pdev, host->irq = pdev->irq; host->irq_flags = IRQF_SHARED; host->pdata = &pci_board_data; + host->fifo_depth = 32; ret = pcim_iomap_regions(pdev, 1 << PCI_BAR_NO, pci_name(pdev)); if (ret) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 4a0b9a6b45f1d..98549a260e377 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3170,7 +3170,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) if (IS_ERR(host->rstc)) return ERR_CAST(host->rstc); - if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth)) + if (device_property_read_u32(dev, "fifo-depth", &host->fifo_depth)) dev_info(dev, "fifo-depth property not found, using value of FIFOTH register as default\n"); @@ -3373,7 +3373,7 @@ int dw_mci_probe(struct dw_mci *host) * FIFO threshold settings RxMark = fifo_size / 2 - 1, * Tx Mark = fifo_size / 2 DMA Size = 8 */ - if (!host->pdata->fifo_depth) { + if (!host->fifo_depth) { /* * Power-on value of RX_WMark is FIFO_DEPTH-1, but this may * have been overwritten by the bootloader, just like we're @@ -3383,7 +3383,7 @@ int dw_mci_probe(struct dw_mci *host) fifo_size = mci_readl(host, FIFOTH); fifo_size = 1 + ((fifo_size >> 16) & 0xfff); } else { - fifo_size = host->pdata->fifo_depth; + fifo_size = host->fifo_depth; } host->fifo_depth = fifo_size; host->fifoth_val = diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 3cac7ce7c0706..bc82d1df75f0d 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -271,12 +271,6 @@ struct dw_mci_board { unsigned int bus_hz; /* Clock speed at the cclk_in pad */ u32 caps; /* Capabilities */ - /* - * Override fifo depth. If 0, autodetect it from the FIFOTH register, - * but note that this may not be reliable after a bootloader has used - * it. - */ - unsigned int fifo_depth; /* delay in mS before detecting cards after interrupt */ u32 detect_delay_ms;