From 9a9d3abe24bb6b820e50190147ac880fd0b168f6 Mon Sep 17 00:00:00 2001 From: Piyush Mehta Date: Mon, 8 Feb 2021 23:33:56 +0530 Subject: ata: ahci: ceva: Update the driver to support xilinx GT phy SATA controller used in Xilinx ZynqMP platform uses xilinx GT phy which has 4 GT lanes and can be used by 4 peripherals at a time. SATA controller uses 1 GT phy lane among the 4 GT lanes. To configure the GT lane for the SATA controller, the below sequence is expected. 1. Assert the SATA controller reset. 2. Configure the xilinx GT phy lane for SATA controller (phy_init). 3. De-assert the SATA controller reset. 4. Wait for PLL of the GT lane used by SATA to be locked (phy_power_on). The ahci_platform_enable_resources() by default does the phy_init() and phy_power_on() but the default sequence doesn't work with Xilinx platforms. Because of this reason, updated the driver to support the new sequence. Added cevapriv->rst check, for backward compatibility with the older sequence. If the reset controller is not available, then the SATA controller will configure with the older sequences. Signed-off-by: Piyush Mehta Acked-by: Michal Simek Signed-off-by: Jens Axboe --- drivers/ata/ahci_ceva.c | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c index b10fd4c8c853..b9802185907d 100644 --- a/drivers/ata/ahci_ceva.c +++ b/drivers/ata/ahci_ceva.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "ahci.h" /* Vendor Specific Register Offsets */ @@ -87,6 +88,7 @@ struct ceva_ahci_priv { u32 axicc; bool is_cci_enabled; int flags; + struct reset_control *rst; }; static unsigned int ceva_ahci_read_id(struct ata_device *dev, @@ -202,13 +204,48 @@ static int ceva_ahci_probe(struct platform_device *pdev) cevapriv->ahci_pdev = pdev; + cevapriv->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, + NULL); + if (IS_ERR(cevapriv->rst)) { + if (PTR_ERR(cevapriv->rst) != -EPROBE_DEFER) + dev_err(&pdev->dev, "failed to get reset: %ld\n", + PTR_ERR(cevapriv->rst)); + } + hpriv = ahci_platform_get_resources(pdev, 0); if (IS_ERR(hpriv)) return PTR_ERR(hpriv); - rc = ahci_platform_enable_resources(hpriv); - if (rc) - return rc; + if (!cevapriv->rst) { + rc = ahci_platform_enable_resources(hpriv); + if (rc) + return rc; + } else { + int i; + + rc = ahci_platform_enable_clks(hpriv); + if (rc) + return rc; + /* Assert the controller reset */ + reset_control_assert(cevapriv->rst); + + for (i = 0; i < hpriv->nports; i++) { + rc = phy_init(hpriv->phys[i]); + if (rc) + return rc; + } + + /* De-assert the controller reset */ + reset_control_deassert(cevapriv->rst); + + for (i = 0; i < hpriv->nports; i++) { + rc = phy_power_on(hpriv->phys[i]); + if (rc) { + phy_exit(hpriv->phys[i]); + return rc; + } + } + } if (of_property_read_bool(np, "ceva,broken-gen2")) cevapriv->flags = CEVA_FLAG_BROKEN_GEN2; -- cgit v1.2.3 From 0ed0283f0297d0bb6b34a831a4989dd58f4c8368 Mon Sep 17 00:00:00 2001 From: Dinghao Liu Date: Wed, 3 Mar 2021 15:34:08 +0800 Subject: sata_dwc_460ex: Fix missing check in sata_dwc_isr The return value of ata_qc_from_tag() is checked in the whole kernel except for two calls in sata_dwc_isr(), which may lead to null-pointer-dereference. Add return value checks to avoid such case. Signed-off-by: Dinghao Liu Signed-off-by: Jens Axboe --- drivers/ata/sata_dwc_460ex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 9dcef6ac643b..f0ef844428bb 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -543,6 +543,11 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance) hsdev->sactive_issued |= qcmd_tag_to_mask(tag); qc = ata_qc_from_tag(ap, tag); + if (unlikely(!qc)) { + dev_err(ap->dev, "failed to get qc"); + handled = 1; + goto DONE; + } /* * Start FP DMA for NCQ command. At this point the tag is the * active tag. It is the tag that matches the command about to @@ -658,6 +663,11 @@ DRVSTILLBUSY: tag_mask &= (~0x00000001); qc = ata_qc_from_tag(ap, tag); + if (unlikely(!qc)) { + dev_err(ap->dev, "failed to get qc"); + handled = 1; + goto DONE; + } /* To be picked up by completion functions */ qc->ap->link.active_tag = tag; -- cgit v1.2.3 From 882184bec5503c449a772662235f8aad46a93f9f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:21 +0000 Subject: ata: libata-transport: Fix some potential doc-rot issues Fixes the following W=1 kernel build warning(s): drivers/ata/libata-transport.c:258: warning: Function parameter or member 'ap' not described in 'ata_tport_delete' drivers/ata/libata-transport.c:258: warning: Excess function parameter 'port' description in 'ata_tport_delete' drivers/ata/libata-transport.c:384: warning: Function parameter or member 'link' not described in 'ata_tlink_delete' drivers/ata/libata-transport.c:384: warning: Excess function parameter 'port' description in 'ata_tlink_delete' drivers/ata/libata-transport.c:640: warning: Function parameter or member 'ata_dev' not described in 'ata_tdev_delete' drivers/ata/libata-transport.c:640: warning: Excess function parameter 'port' description in 'ata_tdev_delete' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/libata-transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c index 6a40e3c6cf49..34bb4608bdc6 100644 --- a/drivers/ata/libata-transport.c +++ b/drivers/ata/libata-transport.c @@ -250,7 +250,7 @@ static int ata_tport_match(struct attribute_container *cont, /** * ata_tport_delete -- remove ATA PORT - * @port: ATA PORT to remove + * @ap: ATA PORT to remove * * Removes the specified ATA PORT. Remove the associated link as well. */ @@ -376,7 +376,7 @@ static int ata_tlink_match(struct attribute_container *cont, /** * ata_tlink_delete -- remove ATA LINK - * @port: ATA LINK to remove + * @link: ATA LINK to remove * * Removes the specified ATA LINK. remove associated ATA device(s) as well. */ @@ -632,7 +632,7 @@ static void ata_tdev_free(struct ata_device *dev) /** * ata_tdev_delete -- remove ATA device - * @port: ATA PORT to remove + * @ata_dev: ATA device to remove * * Removes the specified ATA device. */ -- cgit v1.2.3 From 842a5e584ee5bf9ecdb0c9a31c3dae18b9396ed4 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:22 +0000 Subject: ata: libata-sata: Fix function names in header comments Fixes the following W=1 kernel build warning(s): drivers/ata/libata-sata.c:1085: warning: expecting prototype for port_alloc(). Prototype was for ata_sas_port_alloc() instead drivers/ata/libata-sata.c:1140: warning: expecting prototype for ata_port_stop(). Prototype was for ata_sas_port_stop() instead Cc: Jens Axboe Cc: Tejun Heo Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/libata-sata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index c16423e44525..8adeab76dd38 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1067,7 +1067,7 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) EXPORT_SYMBOL_GPL(ata_scsi_change_queue_depth); /** - * port_alloc - Allocate port for a SAS attached SATA device + * ata_sas_port_alloc - Allocate port for a SAS attached SATA device * @host: ATA host container for all SAS ports * @port_info: Information from low-level host driver * @shost: SCSI host that the scsi device is attached to @@ -1127,7 +1127,7 @@ int ata_sas_port_start(struct ata_port *ap) EXPORT_SYMBOL_GPL(ata_sas_port_start); /** - * ata_port_stop - Undo ata_sas_port_start() + * ata_sas_port_stop - Undo ata_sas_port_start() * @ap: Port to shut down * * May be used as the port_stop() entry in ata_port_operations. -- cgit v1.2.3 From 32db9fad69390774bbbd4fd0659b96a7837a2348 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:23 +0000 Subject: ata: libata-pmp: Fix misspelling of 'val' Fixes the following W=1 kernel build warning(s): drivers/ata/libata-pmp.c:76: warning: Function parameter or member 'val' not described in 'sata_pmp_write' drivers/ata/libata-pmp.c:76: warning: Excess function parameter 'r_val' description in 'sata_pmp_write' Cc: Jens Axboe Cc: Tejun Heo Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/libata-pmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c index 79f2aeeb482a..ba7be3f38617 100644 --- a/drivers/ata/libata-pmp.c +++ b/drivers/ata/libata-pmp.c @@ -62,7 +62,7 @@ static unsigned int sata_pmp_read(struct ata_link *link, int reg, u32 *r_val) * sata_pmp_write - write PMP register * @link: link to write PMP register for * @reg: register to write - * @r_val: value to write + * @val: value to write * * Write PMP register. * -- cgit v1.2.3 From 325fe2088fc9af68914edfae6453214f9e3caaf7 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:24 +0000 Subject: ata: pata_ali: Repair some misnamed kernel-doc issues Fixes the following W=1 kernel build warning(s): drivers/ata/pata_ali.c:119: warning: Function parameter or member 'mask' not described in 'ali_20_filter' drivers/ata/pata_ali.c:119: warning: Excess function parameter 'ap' description in 'ali_20_filter' drivers/ata/pata_ali.c:322: warning: Function parameter or member 'qc' not described in 'ali_check_atapi_dma' drivers/ata/pata_ali.c:322: warning: Excess function parameter 'adev' description in 'ali_check_atapi_dma' Cc: Jens Axboe Cc: CJ Cc: Andre Hedrick Cc: Alan Cox Cc: Clear Zhang Cc: linux-ide@vger.kernel.org Cc: and cc Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_ali.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index 0b122f903b8a..e18aa02f8953 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c @@ -108,7 +108,7 @@ static int ali_c2_cable_detect(struct ata_port *ap) /** * ali_20_filter - filter for earlier ALI DMA - * @ap: ALi ATA port + * @adev: ATA device * @adev: attached device * * Ensure that we do not do DMA on CD devices. We may be able to @@ -313,7 +313,7 @@ static void ali_lock_sectors(struct ata_device *adev) /** * ali_check_atapi_dma - DMA check for most ALi controllers - * @adev: Device + * @qc: Command to complete * * Called to decide whether commands should be sent by DMA or PIO */ -- cgit v1.2.3 From 5c16c0ce50954498282230588258e0e7b6d08dfb Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:25 +0000 Subject: ata: pata_artop: Fix a function name and parameter description Fixes the following W=1 kernel build warning(s): drivers/ata/pata_artop.c:278: warning: expecting prototype for artop_6210_qc_defer(). Prototype was for artop6210_qc_defer() instead drivers/ata/pata_artop.c:359: warning: Function parameter or member 'id' not described in 'artop_init_one' drivers/ata/pata_artop.c:359: warning: Excess function parameter 'ent' description in 'artop_init_one' Cc: Jens Axboe Cc: Andre Hedrick Cc: Thibaut VARENE Cc: Alessandro Zummo Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_artop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index 6bd2228bb6ff..02e4fd5e3b93 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c @@ -344,7 +344,7 @@ static void atp8xx_fixup(struct pci_dev *pdev) /** * artop_init_one - Register ARTOP ATA PCI device with kernel services * @pdev: PCI device to register - * @ent: Entry in artop_pci_tbl matching with @pdev + * @id: PCI device ID * * Called from kernel PCI layer. * -- cgit v1.2.3 From 73b90681d2d55dba93baeb049ce0464d7939e5ca Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:26 +0000 Subject: ata: pata_amd: Remove superfluous, add missing and fix broken params Fixes the following W=1 kernel build warning(s): drivers/ata/pata_amd.c:179: warning: Excess function parameter 'adev' description in 'amd_fifo_setup' drivers/ata/pata_amd.c:331: warning: Function parameter or member 'link' not described in 'nv_pre_reset' drivers/ata/pata_amd.c:331: warning: Function parameter or member 'deadline' not described in 'nv_pre_reset' drivers/ata/pata_amd.c:331: warning: expecting prototype for nv_probe_init(). Prototype was for nv_pre_reset() instead Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 987967f976cb..75b830eb3c54 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c @@ -167,7 +167,6 @@ static int amd_cable_detect(struct ata_port *ap) /** * amd_fifo_setup - set the PIO FIFO for ATA/ATAPI * @ap: ATA interface - * @adev: ATA device * * Set the PCI fifo for this device according to the devices present * on the bus at this point in time. We need to turn the post write buffer @@ -321,7 +320,8 @@ static unsigned long nv_mode_filter(struct ata_device *dev, /** * nv_probe_init - cable detection - * @lin: ATA link + * @link: ATA link + * @deadline: deadline jiffies for the operation * * Perform cable detection. The BIOS stores this in PCI config * space for us. -- cgit v1.2.3 From d6c2aaaee4fb2574abfe75be3707a375db81e74d Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:27 +0000 Subject: ata: pata_hpt366: Provide missing description for 'hpt366_filter()'s 'mask' param Fixes the following W=1 kernel build warning(s): drivers/ata/pata_hpt366.c:200: warning: Function parameter or member 'mask' not described in 'hpt366_filter' Cc: Jens Axboe Cc: Andre Hedrick Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_hpt366.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index 2574d6fbb1ad..06b7c4a9ec95 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c @@ -192,6 +192,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, /** * hpt366_filter - mode selection filter * @adev: ATA device + * @mask: Current mask to manipulate and pass back * * Block UDMA on devices that cause trouble with this controller. */ -- cgit v1.2.3 From a51746f47153b45c865146a4b083693c2faea4aa Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:28 +0000 Subject: ata: pata_hpt37x: Fix some function misnaming and missing param issues Fixes the following W=1 kernel build warning(s): drivers/ata/pata_hpt37x.c:283: warning: Function parameter or member 'mask' not described in 'hpt370_filter' drivers/ata/pata_hpt37x.c:301: warning: Function parameter or member 'mask' not described in 'hpt370a_filter' drivers/ata/pata_hpt37x.c:473: warning: expecting prototype for hpt370_bmdma_end(). Prototype was for hpt370_bmdma_stop() instead drivers/ata/pata_hpt37x.c:567: warning: expecting prototype for hpt37x_bmdma_end(). Prototype was for hpt37x_bmdma_stop() instead Cc: Jens Axboe Cc: Andre Hedrick Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_hpt37x.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index fad6c6a87313..f242157bc81b 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c @@ -275,6 +275,7 @@ static const char * const bad_ata100_5[] = { /** * hpt370_filter - mode selection filter * @adev: ATA device + * @mask: mode mask * * Block UDMA on devices that cause trouble with this controller. */ @@ -293,6 +294,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask) /** * hpt370a_filter - mode selection filter * @adev: ATA device + * @mask: mode mask * * Block UDMA on devices that cause trouble with this controller. */ @@ -463,7 +465,7 @@ static void hpt370_set_dmamode(struct ata_port *ap, struct ata_device *adev) } /** - * hpt370_bmdma_end - DMA engine stop + * hpt370_bmdma_stop - DMA engine stop * @qc: ATA command * * Work around the HPT370 DMA engine. @@ -557,7 +559,7 @@ static void hpt372_set_dmamode(struct ata_port *ap, struct ata_device *adev) } /** - * hpt37x_bmdma_end - DMA engine stop + * hpt37x_bmdma_stop - DMA engine stop * @qc: ATA command * * Clean up after the HPT372 and later DMA engine -- cgit v1.2.3 From 6864e78186e0f8804c29b60308189fd701fe36dc Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:29 +0000 Subject: ata: ahci_xgene: Fix incorrect naming of 'xgene_ahci_handle_broken_edge_irq()'s 'host' param Fixes the following W=1 kernel build warning(s): drivers/ata/ahci_xgene.c:564: warning: Function parameter or member 'host' not described in 'xgene_ahci_handle_broken_edge_irq' drivers/ata/ahci_xgene.c:564: warning: Excess function parameter 'ata_host' description in 'xgene_ahci_handle_broken_edge_irq' Cc: Jens Axboe Cc: Loc Ho Cc: Tuan Phan Cc: Suman Tripathi Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/ahci_xgene.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index 16246c843365..dffc432b9d54 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -537,7 +537,7 @@ softreset_retry: /** * xgene_ahci_handle_broken_edge_irq - Handle the broken irq. - * @ata_host: Host that recieved the irq + * @host: Host that recieved the irq * @irq_masked: HOST_IRQ_STAT value * * For hardware with broken edge trigger latch -- cgit v1.2.3 From f3a23c2cdf55237a13357735776d2f6dabed46ef Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:30 +0000 Subject: ata: sata_mv: Fix worthy headers and demote others Fixes the following W=1 kernel build warning(s): drivers/ata/sata_mv.c:1162: warning: Function parameter or member 'ap' not described in 'mv_start_edma' drivers/ata/sata_mv.c:1162: warning: Function parameter or member 'port_mmio' not described in 'mv_start_edma' drivers/ata/sata_mv.c:1162: warning: Function parameter or member 'protocol' not described in 'mv_start_edma' drivers/ata/sata_mv.c:1162: warning: Excess function parameter 'base' description in 'mv_start_edma' drivers/ata/sata_mv.c:1535: warning: Function parameter or member 'enable_bmdma' not described in 'mv_bmdma_enable_iie' drivers/ata/sata_mv.c:1535: warning: expecting prototype for mv_bmdma_enable(). Prototype was for mv_bmdma_enable_iie() instead drivers/ata/sata_mv.c:1930: warning: Function parameter or member 'ap' not described in 'mv_bmdma_stop_ap' drivers/ata/sata_mv.c:1930: warning: expecting prototype for mv_bmdma_stop(). Prototype was for mv_bmdma_stop_ap() instead drivers/ata/sata_mv.c:2228: warning: Function parameter or member 'ap' not described in 'mv_send_fis' drivers/ata/sata_mv.c:3263: warning: Function parameter or member 'hpriv' not described in 'mv6_reset_hc' drivers/ata/sata_mv.c:3263: warning: Function parameter or member 'n_hc' not described in 'mv6_reset_hc' drivers/ata/sata_mv.c:3541: warning: Function parameter or member 'hpriv' not described in 'soc_is_65n' drivers/ata/sata_mv.c:3541: warning: expecting prototype for soc_is_65(). Prototype was for soc_is_65n() instead Cc: Jens Axboe Cc: Mark Lord Cc: ALWAYS copy Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/sata_mv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 664ef658a955..eafca46d8feb 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -1146,9 +1146,8 @@ static void mv_set_irq_coalescing(struct ata_host *host, spin_unlock_irqrestore(&host->lock, flags); } -/** +/* * mv_start_edma - Enable eDMA engine - * @base: port base address * @pp: port private data * * Verify the local cache of the eDMA state is accurate with a @@ -1519,7 +1518,7 @@ static void mv_60x1_errata_sata25(struct ata_port *ap, int want_ncq) writel(new, hpriv->base + GPIO_PORT_CTL); } -/** +/* * mv_bmdma_enable - set a magic bit on GEN_IIE to allow bmdma * @ap: Port being initialized * @@ -1919,7 +1918,7 @@ static void mv_bmdma_start(struct ata_queued_cmd *qc) /** * mv_bmdma_stop - Stop BMDMA transfer - * @qc: queued command to stop DMA on. + * @ap: port to stop * * Clears the ATA_DMA_START flag in the bmdma control register * @@ -2221,6 +2220,7 @@ static u8 mv_sff_check_status(struct ata_port *ap) /** * mv_send_fis - Send a FIS, using the "Vendor-Unique FIS" register + * @ap: ATA port to send a FIS * @fis: fis to be sent * @nwords: number of 32-bit words in the fis */ @@ -3249,7 +3249,7 @@ static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio) writel(tmp, mmio + GPIO_PORT_CTL); } -/** +/* * mv6_reset_hc - Perform the 6xxx global soft reset * @mmio: base address of the HBA * @@ -3530,7 +3530,7 @@ static void mv_soc_65n_phy_errata(struct mv_host_priv *hpriv, writel(reg, port_mmio + PHY_MODE9_GEN1); } -/** +/* * soc_is_65 - check if the soc is 65 nano device * * Detect the type of the SoC, this is done by reading the PHYCFG_OFS -- cgit v1.2.3 From 764e3bc4e95b5353da039da382968580124253ec Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:31 +0000 Subject: ata: pata_ali: Supply description for 'ali_20_filter()'s 'mask' param Fixes the following W=1 kernel build warning(s): drivers/ata/pata_ali.c:119: warning: Function parameter or member 'mask' not described in 'ali_20_filter' Cc: Jens Axboe Cc: CJ Cc: Andre Hedrick Cc: Alan Cox Cc: Clear Zhang Cc: linux-ide@vger.kernel.org Cc: and cc Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_ali.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index e18aa02f8953..557ecf466102 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c @@ -109,7 +109,7 @@ static int ali_c2_cable_detect(struct ata_port *ap) /** * ali_20_filter - filter for earlier ALI DMA * @adev: ATA device - * @adev: attached device + * @mask: received mask to manipulate and pass back * * Ensure that we do not do DMA on CD devices. We may be able to * fix that later on. Also ensure we do not do UDMA on WDC drives -- cgit v1.2.3 From f18e1faa09f034021fb17f70faaee7e8df4beb5f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:32 +0000 Subject: ata: pata_amd: Fix incorrectly named function in the header Fixes the following W=1 kernel build warning(s): drivers/ata/pata_amd.c:331: warning: expecting prototype for nv_probe_init(). Prototype was for nv_pre_reset() instead Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 75b830eb3c54..c8acba162d02 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c @@ -319,7 +319,7 @@ static unsigned long nv_mode_filter(struct ata_device *dev, } /** - * nv_probe_init - cable detection + * nv_pre_reset - cable detection * @link: ATA link * @deadline: deadline jiffies for the operation * -- cgit v1.2.3 From 9c7d0b2ac49253fd43d220141ed288c60e57ad7f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:33 +0000 Subject: ata: pata_artop: Repair possible copy/paste issue in 'artop_6210_qc_defer()'s header Fixes the following W=1 kernel build warning(s): drivers/ata/pata_artop.c:278: warning: expecting prototype for artop_6210_qc_defer(). Prototype was for artop6210_qc_defer() instead Cc: Jens Axboe Cc: Andre Hedrick Cc: Thibaut VARENE Cc: Alessandro Zummo Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_artop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index 02e4fd5e3b93..ad3c5808aaad 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c @@ -268,7 +268,7 @@ static void artop6260_set_dmamode (struct ata_port *ap, struct ata_device *adev) } /** - * artop_6210_qc_defer - implement serialization + * artop6210_qc_defer - implement serialization * @qc: command * * Issue commands per host on this chip. -- cgit v1.2.3 From 2d35ba9e5a9386519a394c5f9131c54796313af3 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:34 +0000 Subject: ata: pata_atiixp: Fix a function name and supply description for 'pio' Fixes the following W=1 kernel build warning(s): drivers/ata/pata_atiixp.c:103: warning: Function parameter or member 'pio' not described in 'atiixp_set_pio_timing' drivers/ata/pata_atiixp.c:241: warning: expecting prototype for atiixp_dma_stop(). Prototype was for atiixp_bmdma_stop() instead Cc: Jens Axboe Cc: ATI Inc Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_atiixp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index c68aa3f585f2..d671d33ef287 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c @@ -93,6 +93,7 @@ static int atiixp_prereset(struct ata_link *link, unsigned long deadline) * atiixp_set_pio_timing - set initial PIO mode data * @ap: ATA interface * @adev: ATA device + * @pio: Requested PIO * * Called by both the pio and dma setup functions to set the controller * timings for PIO transfers. We must load both the mode number and @@ -227,7 +228,7 @@ static void atiixp_bmdma_start(struct ata_queued_cmd *qc) } /** - * atiixp_dma_stop - DMA stop callback + * atiixp_bmdma_stop - DMA stop callback * @qc: Command in progress * * DMA has completed. Clear the UDMA flag as the next operations will -- cgit v1.2.3 From 4fabc4b67a923a804ae39f7a6a55ed10debcd103 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:35 +0000 Subject: ata: pata_cs5520: Add a couple of missing param descriptions Fixes the following W=1 kernel build warning(s): drivers/ata/pata_cs5520.c:61: warning: Function parameter or member 'pio' not described in 'cs5520_set_timings' drivers/ata/pata_cs5520.c:257: warning: Function parameter or member 'mesg' not described in 'cs5520_pci_device_suspend' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_cs5520.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 9052148b306d..d09d432d3c44 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c @@ -52,6 +52,7 @@ static const struct pio_clocks cs5520_pio_clocks[]={ * cs5520_set_timings - program PIO timings * @ap: ATA port * @adev: ATA device + * @pio: PIO ID * * Program the PIO mode timings for the controller according to the pio * clocking table. @@ -246,6 +247,7 @@ static int cs5520_reinit_one(struct pci_dev *pdev) /** * cs5520_pci_device_suspend - device suspend * @pdev: PCI device + * @mesg: PM event message * * We have to cut and waste bits from the standard method because * the 5520 is a bit odd and not just a pure ATA device. As a result -- cgit v1.2.3 From 2780645c6da8a595f73c503783d9247256448b2d Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:36 +0000 Subject: ata: pata_hpt3x2n: Fix possible doc-rotted function name Fixes the following W=1 kernel build warning(s): drivers/ata/pata_hpt3x2n.c:247: warning: expecting prototype for hpt3x2n_bmdma_end(). Prototype was for hpt3x2n_bmdma_stop() instead Cc: Jens Axboe Cc: Andre Hedrick Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_hpt3x2n.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index 9cb2d50db876..48eef338e050 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c @@ -237,7 +237,7 @@ static void hpt3x2n_set_dmamode(struct ata_port *ap, struct ata_device *adev) } /** - * hpt3x2n_bmdma_end - DMA engine stop + * hpt3x2n_bmdma_stop - DMA engine stop * @qc: ATA command * * Clean up after the HPT3x2n and later DMA engine -- cgit v1.2.3 From a446e2fb552207d33ac08b609e997f2e4a501288 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:37 +0000 Subject: ata: pata_marvell: Fix incorrectly documented function parameter Fixes the following W=1 kernel build warning(s): drivers/ata/pata_marvell.c:125: warning: Function parameter or member 'id' not described in 'marvell_init_one' drivers/ata/pata_marvell.c:125: warning: Excess function parameter 'ent' description in 'marvell_init_one' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_marvell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c index b066809ba9a1..361597d14c56 100644 --- a/drivers/ata/pata_marvell.c +++ b/drivers/ata/pata_marvell.c @@ -110,7 +110,7 @@ static struct ata_port_operations marvell_ops = { /** * marvell_init_one - Register Marvell ATA PCI device with kernel services * @pdev: PCI device to register - * @ent: Entry in marvell_pci_tbl matching with @pdev + * @id: PCI device ID * * Called from kernel PCI layer. * -- cgit v1.2.3 From efd2cbe82f503e6fa3509987c7d46f39c7bd37a1 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:38 +0000 Subject: ata: pata_jmicron: Fix incorrectly documented function parameter Fixes the following W=1 kernel build warning(s): drivers/ata/pata_jmicron.c:135: warning: Function parameter or member 'id' not described in 'jmicron_init_one' drivers/ata/pata_jmicron.c:135: warning: Excess function parameter 'ent' description in 'jmicron_init_one' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_jmicron.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c index c3dedd3e71fb..d1b3ce8958dd 100644 --- a/drivers/ata/pata_jmicron.c +++ b/drivers/ata/pata_jmicron.c @@ -120,7 +120,7 @@ static struct ata_port_operations jmicron_ops = { /** * jmicron_init_one - Register Jmicron ATA PCI device with kernel services * @pdev: PCI device to register - * @ent: Entry in jmicron_pci_tbl matching with @pdev + * @id: PCI device ID * * Called from kernel PCI layer. * -- cgit v1.2.3 From 92a5e8827c9e1a851d8c7967e70fe247d4427f7d Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:39 +0000 Subject: ata: pata_optidma: Fix a function misnaming, a formatting issue and a missing description Fixes the following W=1 kernel build warning(s): drivers/ata/pata_optidma.c:298: warning: expecting prototype for optidma_make_bits(). Prototype was for optidma_make_bits43() instead drivers/ata/pata_optidma.c:319: warning: Function parameter or member 'r_failed' not described in 'optidma_set_mode' drivers/ata/pata_optidma.c:361: warning: Function parameter or member 'pdev' not described in 'optiplus_with_udma' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_optidma.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c index fbcf0af34924..f6278d9de348 100644 --- a/drivers/ata/pata_optidma.c +++ b/drivers/ata/pata_optidma.c @@ -287,7 +287,7 @@ static void optiplus_set_dma_mode(struct ata_port *ap, struct ata_device *adev) } /** - * optidma_make_bits - PCI setup helper + * optidma_make_bits43 - PCI setup helper * @adev: ATA device * * Turn the ATA device setup into PCI configuration bits @@ -309,6 +309,7 @@ static u8 optidma_make_bits43(struct ata_device *adev) /** * optidma_set_mode - mode setup * @link: link to set up + * @r_failed: out parameter for failed device * * Use the standard setup to tune the chipset and then finalise the * configuration by writing the nibble of extra bits of data into @@ -354,7 +355,7 @@ static struct ata_port_operations optiplus_port_ops = { /** * optiplus_with_udma - Look for UDMA capable setup - * @pdev; ATA controller + * @pdev: ATA controller */ static int optiplus_with_udma(struct pci_dev *pdev) -- cgit v1.2.3 From 1906cf27fcc07075ccfccf138fe269f8a95d7795 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 1 Feb 2021 14:39:40 +0000 Subject: ata: pata_pdc2027x: Fix some incorrect function names and parameter docs Fixes the following W=1 kernel build warning(s): drivers/ata/pata_pdc2027x.c:209: warning: expecting prototype for pdc2027x_pata_cable_detect(). Prototype was for pdc2027x_cable_detect() instead drivers/ata/pata_pdc2027x.c:262: warning: expecting prototype for pdc2720x_mode_filter(). Prototype was for pdc2027x_mode_filter() instead drivers/ata/pata_pdc2027x.c:513: warning: Function parameter or member 'board_idx' not described in 'pdc_adjust_pll' drivers/ata/pata_pdc2027x.c:513: warning: expecting prototype for adjust_pll(). Prototype was for pdc_adjust_pll() instead drivers/ata/pata_pdc2027x.c:599: warning: expecting prototype for detect_pll_input_clock(). Prototype was for pdc_detect_pll_input_clock() instead Cc: Jens Axboe Cc: Albert Lee Cc: Andre Hedrick Cc: Frank Tiernan Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Jens Axboe --- drivers/ata/pata_pdc2027x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c index de834fbb6dfe..effc1a09444d 100644 --- a/drivers/ata/pata_pdc2027x.c +++ b/drivers/ata/pata_pdc2027x.c @@ -196,7 +196,7 @@ static inline void __iomem *dev_mmio(struct ata_port *ap, struct ata_device *ade } /** - * pdc2027x_pata_cable_detect - Probe host controller cable detect info + * pdc2027x_cable_detect - Probe host controller cable detect info * @ap: Port for which cable detect info is desired * * Read 80c cable indicator from Promise extended register. @@ -251,7 +251,7 @@ static int pdc2027x_prereset(struct ata_link *link, unsigned long deadline) } /** - * pdc2720x_mode_filter - mode selection filter + * pdc2027x_mode_filter - mode selection filter * @adev: ATA device * @mask: list of modes proposed * @@ -503,11 +503,11 @@ retry: } /** - * adjust_pll - Adjust the PLL input clock in Hz. + * pdc_adjust_pll - Adjust the PLL input clock in Hz. * - * @pdc_controller: controller specific information * @host: target ATA host * @pll_clock: The input of PLL in HZ + * @board_idx: board identifier */ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int board_idx) { @@ -590,7 +590,7 @@ static void pdc_adjust_pll(struct ata_host *host, long pll_clock, unsigned int b } /** - * detect_pll_input_clock - Detect the PLL input clock in Hz. + * pdc_detect_pll_input_clock - Detect the PLL input clock in Hz. * @host: target ATA host * Ex. 16949000 on 33MHz PCI bus for pdc20275. * Half of the PCI clock. -- cgit v1.2.3 From 2b0a9946bf9e182b77d500ac182f73d5078c7ef1 Mon Sep 17 00:00:00 2001 From: Bhaskar Chowdhury Date: Fri, 12 Mar 2021 14:27:38 +0530 Subject: ata: Trivial spelling fixes in the file pata_ns87415.c Trivial spelling fixes. Signed-off-by: Bhaskar Chowdhury Link: https://lore.kernel.org/r/20210312085738.9372-1-unixbhaskar@gmail.com Signed-off-by: Jens Axboe --- drivers/ata/pata_ns87415.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c index 1532b2e3c672..f4949e704356 100644 --- a/drivers/ata/pata_ns87415.c +++ b/drivers/ata/pata_ns87415.c @@ -113,7 +113,7 @@ static void ns87415_set_piomode(struct ata_port *ap, struct ata_device *adev) * ns87415_bmdma_setup - Set up DMA * @qc: Command block * - * Set up for bus masterng DMA. We have to do this ourselves + * Set up for bus mastering DMA. We have to do this ourselves * rather than use the helper due to a chip erratum */ @@ -174,7 +174,7 @@ static void ns87415_bmdma_stop(struct ata_queued_cmd *qc) * ns87415_irq_clear - Clear interrupt * @ap: Channel to clear * - * Erratum: Due to a chip bug regisers 02 and 0A bit 1 and 2 (the + * Erratum: Due to a chip bug registers 02 and 0A bit 1 and 2 (the * error bits) are reset by writing to register 00 or 08. */ -- cgit v1.2.3 From c7e8f404d56b99c80990b19a402c3f640d74be05 Mon Sep 17 00:00:00 2001 From: Sergey Shtylyov Date: Thu, 25 Mar 2021 23:50:24 +0300 Subject: pata_arasan_cf: fix IRQ check The driver's probe() method is written as if platform_get_irq() returns 0 on error, while actually it returns a negative error code (with all the other values considered valid IRQs). Rewrite the driver's IRQ checking code to pass the positive IRQ #s to ata_host_activate(), propagate upstream -EPROBE_DEFER, and set up the driver to polling mode on (negative) errors and IRQ0 (libata treats IRQ #0 as a polling mode anyway)... Fixes: a480167b23ef ("pata_arasan_cf: Adding support for arasan compact flash host controller") Signed-off-by: Sergey Shtylyov Acked-by: Viresh Kumar Signed-off-by: Jens Axboe --- drivers/ata/pata_arasan_cf.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index e9cf31f38450..63f39440a9b4 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c @@ -818,12 +818,19 @@ static int arasan_cf_probe(struct platform_device *pdev) else quirk = CF_BROKEN_UDMA; /* as it is on spear1340 */ - /* if irq is 0, support only PIO */ - acdev->irq = platform_get_irq(pdev, 0); - if (acdev->irq) + /* + * If there's an error getting IRQ (or we do get IRQ0), + * support only PIO + */ + ret = platform_get_irq(pdev, 0); + if (ret > 0) { + acdev->irq = ret; irq_handler = arasan_cf_interrupt; - else + } else if (ret == -EPROBE_DEFER) { + return ret; + } else { quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA; + } acdev->pbase = res->start; acdev->vbase = devm_ioremap(&pdev->dev, res->start, -- cgit v1.2.3 From e379b40cc0f179403ce0b82b7e539f635a568da5 Mon Sep 17 00:00:00 2001 From: Sergey Shtylyov Date: Thu, 25 Mar 2021 23:51:10 +0300 Subject: pata_ipx4xx_cf: fix IRQ check The driver's probe() method is written as if platform_get_irq() returns 0 on error, while actually it returns a negative error code (with all the other values considered valid IRQs). Rewrite the driver's IRQ checking code to pass the positive IRQ #s to ata_host_activate(), propagate errors upstream, and treat IRQ0 as error, returning -EINVAL, as the libata code treats 0 as an indication that polling should be used anyway... Fixes: 0df0d0a0ea9f ("[libata] ARM: add ixp4xx PATA driver") Signed-off-by: Sergey Shtylyov Signed-off-by: Jens Axboe --- drivers/ata/pata_ixp4xx_cf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index d1644a8ef9fa..abc0e87ca1a8 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c @@ -165,8 +165,12 @@ static int ixp4xx_pata_probe(struct platform_device *pdev) return -ENOMEM; irq = platform_get_irq(pdev, 0); - if (irq) + if (irq > 0) irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING); + else if (irq < 0) + return irq; + else + return -EINVAL; /* Setup expansion bus chip selects */ *data->cs0_cfg = data->cs0_bits; -- cgit v1.2.3 From ffa137cb8d17902a44bd473d1ff56485dbb19b7c Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:36 +0000 Subject: ata: pata_pdc202xx_old: Fix some incorrectly named functions Fixes the following W=1 kernel build warning(s): drivers/ata/pata_pdc202xx_old.c:127: warning: expecting prototype for pdc202xx_configure_dmamode(). Prototype was for pdc202xx_set_dmamode() instead drivers/ata/pata_pdc202xx_old.c:228: warning: expecting prototype for pdc2026x_bmdma_end(). Prototype was for pdc2026x_bmdma_stop() instead Cc: Jens Axboe Cc: Alan Cox Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-2-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_pdc202xx_old.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c index 378ed9ea97e9..0c5cbcd28d0d 100644 --- a/drivers/ata/pata_pdc202xx_old.c +++ b/drivers/ata/pata_pdc202xx_old.c @@ -115,7 +115,7 @@ static void pdc202xx_set_piomode(struct ata_port *ap, struct ata_device *adev) } /** - * pdc202xx_configure_dmamode - set DMA mode in chip + * pdc202xx_set_dmamode - set DMA mode in chip * @ap: ATA interface * @adev: ATA device * @@ -214,7 +214,7 @@ static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc) } /** - * pdc2026x_bmdma_end - DMA engine stop + * pdc2026x_bmdma_stop - DMA engine stop * @qc: ATA command * * After a DMA completes we need to put the clock back to 33MHz for -- cgit v1.2.3 From 91c50d8a1f9a28b3725154bc0046d8ac4bf11796 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:37 +0000 Subject: ata: pata_sil680: Add some missing function parameter docs Fixes the following W=1 kernel build warning(s): drivers/ata/pata_sil680.c:68: warning: Function parameter or member 'adev' not described in 'sil680_seldev' drivers/ata/pata_sil680.c:254: warning: Function parameter or member 'try_mmio' not described in 'sil680_init_chip' Cc: Jens Axboe Cc: Andre Hedrick Cc: Red Hat Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-3-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_sil680.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c index 7ab9aea3b630..43215a664b96 100644 --- a/drivers/ata/pata_sil680.c +++ b/drivers/ata/pata_sil680.c @@ -57,6 +57,7 @@ static unsigned long sil680_selreg(struct ata_port *ap, int r) /** * sil680_seldev - return register base * @ap: ATA interface + * @adev: ATA device * @r: config offset * * Turn a config register offset into the right address in PCI space @@ -244,6 +245,7 @@ static struct ata_port_operations sil680_port_ops = { /** * sil680_init_chip - chip setup * @pdev: PCI device + * @try_mmio: Indicates to caller whether MMIO should be attempted * * Perform all the chip setup which must be done both when the device * is powered up on boot and when we resume in case we resumed from RAM. -- cgit v1.2.3 From 8927c41e3118e0d00ea88c1a0a7ffa360ec3bf8e Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:38 +0000 Subject: ata: pata_sis: Remove superfluous param description and supply another Fixes the following W=1 kernel build warning(s): drivers/ata/pata_sis.c:124: warning: Excess function parameter 'deadline' description in 'sis_133_cable_detect' drivers/ata/pata_sis.c:529: warning: Function parameter or member 'mask' not described in 'sis_133_mode_filter' Cc: Jens Axboe Cc: Andre Hedrick Cc: Lionel Bouton Cc: Vojtech Pavlik Cc: "L.C. Chang" Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-4-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_sis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index d7cd39a9888a..b5b764e18adf 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c @@ -114,7 +114,6 @@ static int sis_port_base(struct ata_device *adev) /** * sis_133_cable_detect - check for 40/80 pin * @ap: Port - * @deadline: deadline jiffies for the operation * * Perform cable detection for the later UDMA133 capable * SiS chipset. @@ -521,6 +520,7 @@ static void sis_133_set_dmamode (struct ata_port *ap, struct ata_device *adev) /** * sis_133_mode_filter - mode selection filter * @adev: ATA device + * @mask: received mask to manipulate and pass back * * Block UDMA6 on devices that do not support it. */ -- cgit v1.2.3 From 2ee628f3cf2584927ab30c585bfa268247486731 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:39 +0000 Subject: ata: pata_triflex: Repair some misnamed functions and fix some param descriptions Fixes the following W=1 kernel build warning(s): drivers/ata/pata_triflex.c:143: warning: expecting prototype for triflex_dma_start(). Prototype was for triflex_bmdma_start() instead drivers/ata/pata_triflex.c:159: warning: Function parameter or member 'qc' not described in 'triflex_bmdma_stop' drivers/ata/pata_triflex.c:159: warning: expecting prototype for triflex_dma_stop(). Prototype was for triflex_bmdma_stop() instead Cc: Jens Axboe Cc: Alan Cox Cc: Torben Mathiasen Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-5-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_triflex.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_triflex.c b/drivers/ata/pata_triflex.c index 2a4d38b98026..8a033598e7e1 100644 --- a/drivers/ata/pata_triflex.c +++ b/drivers/ata/pata_triflex.c @@ -129,7 +129,7 @@ static void triflex_set_piomode(struct ata_port *ap, struct ata_device *adev) } /** - * triflex_dma_start - DMA start callback + * triflex_bmdma_start - DMA start callback * @qc: Command in progress * * Usually drivers set the DMA timing at the point the set_dmamode call @@ -146,9 +146,8 @@ static void triflex_bmdma_start(struct ata_queued_cmd *qc) } /** - * triflex_dma_stop - DMA stop callback - * @ap: ATA interface - * @adev: ATA device + * triflex_bmdma_stop - DMA stop callback + * @qc: ATA command * * We loaded new timings in dma_start, as a result we need to restore * the PIO timings in dma_stop so that the next command issue gets the -- cgit v1.2.3 From 39ac4018c85bd5435ff3b47cc602dbdf87be54ac Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:40 +0000 Subject: ata: pata_it821x: Fix possible doc-rotted function names Fixes the following W=1 kernel build warning(s): drivers/ata/pata_it821x.c:346: warning: expecting prototype for it821x_passthru_dma_start(). Prototype was for it821x_passthru_bmdma_start() instead drivers/ata/pata_it821x.c:369: warning: expecting prototype for it821x_passthru_dma_stop(). Prototype was for it821x_passthru_bmdma_stop() instead Cc: Jens Axboe Cc: Alan Cox Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-6-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_it821x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 9bac79edbc2c..0e2265978a34 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -334,7 +334,7 @@ static void it821x_passthru_set_dmamode(struct ata_port *ap, struct ata_device * } /** - * it821x_passthru_dma_start - DMA start callback + * it821x_passthru_bmdma_start - DMA start callback * @qc: Command in progress * * Usually drivers set the DMA timing at the point the set_dmamode call @@ -357,7 +357,7 @@ static void it821x_passthru_bmdma_start(struct ata_queued_cmd *qc) } /** - * it821x_passthru_dma_stop - DMA stop callback + * it821x_passthru_bmdma_stop - DMA stop callback * @qc: ATA command * * We loaded new timings in dma_start, as a result we need to restore -- cgit v1.2.3 From 87eac27c920477059f766acea1c4390934738d11 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:41 +0000 Subject: ata: pata_via: Fix a kernel-doc formatting issue Fixes the following W=1 kernel build warning(s): drivers/ata/pata_via.c:675: warning: Function parameter or member 'pdev' not described in 'via_reinit_one' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-7-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_via.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 38044e679795..475032048984 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c @@ -663,7 +663,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) #ifdef CONFIG_PM_SLEEP /** * via_reinit_one - reinit after resume - * @pdev; PCI device + * @pdev: PCI device * * Called when the VIA PATA device is resumed. We must then * reconfigure the fifo and other setup we may have altered. In -- cgit v1.2.3 From 05f4226ac537cc5fb43bc6f24c2dca54302300ae Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:42 +0000 Subject: ata: pata_piccolo: 'ata_tosh_init()' is misnamed in its header Fixes the following W=1 kernel build warning(s): drivers/ata/pata_piccolo.c:87: warning: expecting prototype for ata_tosh_init(). Prototype was for ata_tosh_init_one() instead Cc: Jens Axboe Cc: Andre Hedrick Cc: Hat Inc Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-8-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_piccolo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_piccolo.c b/drivers/ata/pata_piccolo.c index 35cb0e263237..389b63b13c70 100644 --- a/drivers/ata/pata_piccolo.c +++ b/drivers/ata/pata_piccolo.c @@ -74,7 +74,7 @@ static struct ata_port_operations tosh_port_ops = { }; /** - * ata_tosh_init - attach generic IDE + * ata_tosh_init_one - attach generic IDE * @dev: PCI device found * @id: match entry * -- cgit v1.2.3 From d29b031d43fbd46ce683572909427f1588f6f2ce Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:43 +0000 Subject: ata: pata_sl82c105: Fix potential doc-rot Fixes the following W=1 kernel build warning(s): drivers/ata/pata_sl82c105.c:191: warning: expecting prototype for sl82c105_bmdma_end(). Prototype was for sl82c105_bmdma_stop() instead Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-9-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_sl82c105.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c index ac7ddd87f188..8487470e2e01 100644 --- a/drivers/ata/pata_sl82c105.c +++ b/drivers/ata/pata_sl82c105.c @@ -173,7 +173,7 @@ static void sl82c105_bmdma_start(struct ata_queued_cmd *qc) } /** - * sl82c105_bmdma_end - DMA engine stop + * sl82c105_bmdma_stop - DMA engine stop * @qc: ATA command * * Reset the DMA engine each use as recommended by the errata -- cgit v1.2.3 From dee1d6f3c70d5b3894c113b1d11d5e7eb0394efb Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:44 +0000 Subject: ata: pata_opti: Fix spelling issue of 'val' in 'opti_write_reg()' Fixes the following W=1 kernel build warning(s): drivers/ata/pata_opti.c:82: warning: Function parameter or member 'val' not described in 'opti_write_reg' drivers/ata/pata_opti.c:82: warning: Excess function parameter 'value' description in 'opti_write_reg' Cc: Jens Axboe Cc: Jaromir Koutek Cc: Jan Harkes Cc: Mark Lord Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-10-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_opti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c index 06a800a3b070..01976c4e4033 100644 --- a/drivers/ata/pata_opti.c +++ b/drivers/ata/pata_opti.c @@ -69,7 +69,7 @@ static int opti_pre_reset(struct ata_link *link, unsigned long deadline) /** * opti_write_reg - control register setup * @ap: ATA port - * @value: value + * @val: value * @reg: control register number * * The Opti uses magic 'trapdoor' register accesses to do configuration -- cgit v1.2.3 From b7ab575f80f6168dea1bfd13e5aec537a869a53b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:45 +0000 Subject: ata: ata_generic: Fix misspelling of 'ata_generic_init_one()' Fixes the following W=1 kernel build warning(s): drivers/ata/ata_generic.c:164: warning: expecting prototype for ata_generic_init(). Prototype was for ata_generic_init_one() instead Cc: Jens Axboe Cc: Andre Hedrick Cc: Hat Inc Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-11-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/ata_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 9ff545ce8da3..20a32e4d501d 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c @@ -151,7 +151,7 @@ static int is_intel_ider(struct pci_dev *dev) } /** - * ata_generic_init - attach generic IDE + * ata_generic_init_one - attach generic IDE * @dev: PCI device found * @id: match entry * -- cgit v1.2.3 From 145f74fa6254e4da4a33c9f22e1c804dd426fc8b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:46 +0000 Subject: ata: pata_legacy: Repair a couple kernel-doc problems Fixes the following W=1 kernel build warning(s): drivers/ata/pata_legacy.c:606: warning: expecting prototype for opt82c465mv_qc_issue(). Prototype was for opti82c46x_qc_issue() instead drivers/ata/pata_legacy.c:933: warning: Function parameter or member 'probe' not described in 'legacy_init_one' drivers/ata/pata_legacy.c:933: warning: Excess function parameter 'pl' description in 'legacy_init_one' drivers/ata/pata_legacy.c:1024: warning: Function parameter or member 'primary' not described in 'legacy_check_special_cases' drivers/ata/pata_legacy.c:1024: warning: Function parameter or member 'secondary' not described in 'legacy_check_special_cases' drivers/ata/pata_legacy.c:1024: warning: Excess function parameter 'master' description in 'legacy_check_special_cases' drivers/ata/pata_legacy.c:1024: warning: Excess function parameter 'master' description in 'legacy_check_special_cases' Cc: Jens Axboe Cc: Colten Edwards Cc: Samuel Thibault Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-12-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_legacy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 4fd12b20df23..a7235bde6ae8 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -588,7 +588,7 @@ static void opti82c46x_set_piomode(struct ata_port *ap, struct ata_device *adev) } /** - * opt82c465mv_qc_issue - command issue + * opti82c46x_qc_issue - command issue * @qc: command pending * * Called when the libata layer is about to issue a command. We wrap @@ -923,7 +923,7 @@ static __init int probe_chip_type(struct legacy_probe *probe) /** * legacy_init_one - attach a legacy interface - * @pl: probe record + * @probe: probe record * * Register an ISA bus IDE interface. Such interfaces are PIO and we * assume do not support IRQ sharing. @@ -1009,8 +1009,8 @@ fail: /** * legacy_check_special_cases - ATA special cases * @p: PCI device to check - * @master: set this if we find an ATA master - * @master: set this if we find an ATA secondary + * @primary: set this if we find an ATA master + * @secondary: set this if we find an ATA secondary * * A small number of vendors implemented early PCI ATA interfaces * on bridge logic without the ATA interface being PCI visible. -- cgit v1.2.3 From 1cade50f5092a09001b33209cd81426122f0af19 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:47 +0000 Subject: ata: pata_cs5530: Fix misspelling of 'cs5530_init_one()'s 'pdev' param Fixes the following W=1 kernel build warning(s): drivers/ata/pata_cs5530.c:283: warning: Function parameter or member 'pdev' not described in 'cs5530_init_one' drivers/ata/pata_cs5530.c:283: warning: Excess function parameter 'dev' description in 'cs5530_init_one' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-13-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_cs5530.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c index ad75d02b6dac..a1b4aaccaa50 100644 --- a/drivers/ata/pata_cs5530.c +++ b/drivers/ata/pata_cs5530.c @@ -271,7 +271,7 @@ fail_put: /** * cs5530_init_one - Initialise a CS5530 - * @dev: PCI device + * @pdev: PCI device * @id: Entry in match table * * Install a driver for the newly found CS5530 companion chip. Most of -- cgit v1.2.3 From c172b359d71156a41fe036f1aa8f9560938fd9bf Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:48 +0000 Subject: ata: sata_mv: Fix misnaming of 'mv_bmdma_stop()' Fixes the following W=1 kernel build warning(s): drivers/ata/sata_mv.c:1929: warning: expecting prototype for mv_bmdma_stop(). Prototype was for mv_bmdma_stop_ap() instead Cc: Jens Axboe Cc: Mark Lord Cc: ALWAYS copy Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-14-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/sata_mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index eafca46d8feb..bd23d63435cb 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -1917,7 +1917,7 @@ static void mv_bmdma_start(struct ata_queued_cmd *qc) } /** - * mv_bmdma_stop - Stop BMDMA transfer + * mv_bmdma_stop_ap - Stop BMDMA transfer * @ap: port to stop * * Clears the ATA_DMA_START flag in the bmdma control register -- cgit v1.2.3 From c86a2a28bde8b173664893da47137cdbe3d5b14f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:49 +0000 Subject: ata: libata-acpi: Fix function name and provide description for 'prev_gtf' Fixes the following W=1 kernel build warning(s): drivers/ata/libata-acpi.c:493: warning: expecting prototype for ata_acpi_gtm_xfermode(). Prototype was for ata_acpi_gtm_xfermask() instead drivers/ata/libata-acpi.c:648: warning: Function parameter or member 'prev_gtf' not described in 'ata_acpi_run_tf' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-15-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/libata-acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 224e3486e9a5..7a7d6642edcc 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -476,7 +476,7 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf) } /** - * ata_acpi_gtm_xfermode - determine xfermode from GTM parameter + * ata_acpi_gtm_xfermask - determine xfermode from GTM parameter * @dev: target device * @gtm: GTM parameter to use * @@ -624,6 +624,7 @@ static int ata_acpi_filter_tf(struct ata_device *dev, * ata_acpi_run_tf - send taskfile registers to host controller * @dev: target ATA device * @gtf: raw ATA taskfile register set (0x1f1 - 0x1f7) + * @prev_gtf: previous command * * Outputs ATA taskfile to standard ATA host controller. * Writes the control, feature, nsect, lbal, lbam, and lbah registers. -- cgit v1.2.3 From ff237990277ff3a94ba4848c991bef24fd175cc0 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 08:51:50 +0000 Subject: ata: pata_acpi: Fix some incorrect function param descriptions Fixes the following W=1 kernel build warning(s): drivers/ata/pata_acpi.c:38: warning: Function parameter or member 'link' not described in 'pacpi_pre_reset' drivers/ata/pata_acpi.c:38: warning: Excess function parameter 'ap' description in 'pacpi_pre_reset' drivers/ata/pata_acpi.c:74: warning: Function parameter or member 'ap' not described in 'pacpi_discover_modes' drivers/ata/pata_acpi.c:74: warning: Excess function parameter 'mask' description in 'pacpi_discover_modes' drivers/ata/pata_acpi.c:239: warning: Function parameter or member 'id' not described in 'pacpi_init_one' drivers/ata/pata_acpi.c:239: warning: Excess function parameter 'ent' description in 'pacpi_init_one' Cc: Jens Axboe Cc: linux-ide@vger.kernel.org Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210318085150.3131936-16-lee.jones@linaro.org Signed-off-by: Jens Axboe --- drivers/ata/pata_acpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c index fa2bfc344a97..ade4c3eee230 100644 --- a/drivers/ata/pata_acpi.c +++ b/drivers/ata/pata_acpi.c @@ -28,7 +28,7 @@ struct pata_acpi { /** * pacpi_pre_reset - check for 40/80 pin - * @ap: Port + * @link: ATA link * @deadline: deadline jiffies for the operation * * Perform the PATA port setup we need. @@ -63,8 +63,8 @@ static int pacpi_cable_detect(struct ata_port *ap) /** * pacpi_discover_modes - filter non ACPI modes + * @ap: ATA port * @adev: ATA device - * @mask: proposed modes * * Try the modes available and see which ones the ACPI method will * set up sensibly. From this we get a mask of ACPI modes we can use @@ -224,7 +224,7 @@ static struct ata_port_operations pacpi_ops = { /** * pacpi_init_one - Register ACPI ATA PCI device with kernel services * @pdev: PCI device to register - * @ent: Entry in pacpi_pci_tbl matching with @pdev + * @id: PCI device ID * * Called from kernel PCI layer. * -- cgit v1.2.3 From e6471a65fdd5efbb8dd2732dd0f063f960685ceb Mon Sep 17 00:00:00 2001 From: Sergey Shtylyov Date: Sun, 28 Mar 2021 00:13:49 +0300 Subject: sata_mv: add IRQ checks The function mv_platform_probe() neglects to check the results of the calls to platform_get_irq() and irq_of_parse_and_map() and blithely passes them to ata_host_activate() -- while the latter only checks for IRQ0 (treating it as a polling mode indicattion) and passes the negative values to devm_request_irq() causing it to fail as it takes unsigned values for the IRQ #... Add to mv_platform_probe() the proper IRQ checks to pass the positive IRQ #s to ata_host_activate(), propagate upstream the negative error codes, and override the IRQ0 with -EINVAL (as we don't want the polling mode). Fixes: f351b2d638c3 ("sata_mv: Support SoC controllers") Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/51436f00-27a1-e20b-c21b-0e817e0a7c86@omprussia.ru Signed-off-by: Jens Axboe --- drivers/ata/sata_mv.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index bd23d63435cb..c8867c12c0b8 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -4097,6 +4097,10 @@ static int mv_platform_probe(struct platform_device *pdev) n_ports = mv_platform_data->n_ports; irq = platform_get_irq(pdev, 0); } + if (irq < 0) + return irq; + if (!irq) + return -EINVAL; host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports); hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL); -- cgit v1.2.3 From b30d0040f06159de97ad9c0b1536f47250719d7d Mon Sep 17 00:00:00 2001 From: Sergey Shtylyov Date: Mon, 15 Mar 2021 23:15:06 +0300 Subject: ata: libahci_platform: fix IRQ check Iff platform_get_irq() returns 0, ahci_platform_init_host() would return 0 early (as if the call was successful). Override IRQ0 with -EINVAL instead as the 'libata' regards 0 as "no IRQ" (thus polling) anyway... Fixes: c034640a32f8 ("ata: libahci: properly propagate return value of platform_get_irq()") Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/4448c8cc-331f-2915-0e17-38ea34e251c8@omprussia.ru Signed-off-by: Jens Axboe --- drivers/ata/libahci_platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index de638dafce21..b2f552088291 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platform_device *pdev, int i, irq, n_ports, rc; irq = platform_get_irq(pdev, 0); - if (irq <= 0) { + if (irq < 0) { if (irq != -EPROBE_DEFER) dev_err(dev, "no irq\n"); return irq; } + if (!irq) + return -EINVAL; hpriv->irq = irq; -- cgit v1.2.3 From 234e6d2c18f5b080cde874483c4c361f3ae7cffe Mon Sep 17 00:00:00 2001 From: Xingui Yang Date: Fri, 12 Mar 2021 18:24:36 +0800 Subject: ata: ahci: Disable SXS for Hisilicon Kunpeng920 On Hisilicon Kunpeng920, ESP is set to 1 by default for all ports of SATA controller. In some scenarios, some ports are not external SATA ports, and it cause disks connected to these ports to be identified as removable disks. So disable the SXS capability on the software side to prevent users from mistakenly considering non-removable disks as removable disks and performing related operations. Signed-off-by: Xingui Yang Signed-off-by: Luo Jiaxing Reviewed-by: John Garry Link: https://lore.kernel.org/r/1615544676-61926-1-git-send-email-luojiaxing@huawei.com Signed-off-by: Jens Axboe --- drivers/ata/ahci.c | 5 +++++ drivers/ata/ahci.h | 1 + drivers/ata/libahci.c | 5 +++++ 3 files changed, 11 insertions(+) (limited to 'drivers') diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 00ba8e5a1ccc..33192a8f687d 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1772,6 +1772,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) hpriv->flags |= AHCI_HFLAG_NO_DEVSLP; #ifdef CONFIG_ARM64 + if (pdev->vendor == PCI_VENDOR_ID_HUAWEI && + pdev->device == 0xa235 && + pdev->revision < 0x30) + hpriv->flags |= AHCI_HFLAG_NO_SXS; + if (pdev->vendor == 0x177d && pdev->device == 0xa01c) hpriv->irq_handler = ahci_thunderx_irq_handler; #endif diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 98b8baa47dc5..d1f284f0c83d 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -242,6 +242,7 @@ enum { suspend/resume */ AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP from phy_power_on() */ + AHCI_HFLAG_NO_SXS = (1 << 28), /* SXS not supported */ /* ap->flags bits */ diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index ea5bf5f4cbed..fec2e9754aed 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -493,6 +493,11 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv) cap |= HOST_CAP_ALPM; } + if ((cap & HOST_CAP_SXS) && (hpriv->flags & AHCI_HFLAG_NO_SXS)) { + dev_info(dev, "controller does not support SXS, disabling CAP_SXS\n"); + cap &= ~HOST_CAP_SXS; + } + if (hpriv->force_port_map && port_map != hpriv->force_port_map) { dev_info(dev, "forcing port_map 0x%x -> 0x%x\n", port_map, hpriv->force_port_map); -- cgit v1.2.3 From fa4b42b2a968dc137f15e3104a3ec669875dd669 Mon Sep 17 00:00:00 2001 From: Piyush Mehta Date: Fri, 5 Mar 2021 14:40:29 +0530 Subject: ata: ahci: ceva: Updated code by using dev_err_probe() Updated code with already prepared dev_err_probe(). It reduces code size and simplifies EPROBE_DEFER handling. Also, unify message format for similar error cases. Signed-off-by: Piyush Mehta Acked-by: Michal Simek Link: https://lore.kernel.org/r/20210305091029.23378-1-piyush.mehta@xilinx.com Signed-off-by: Jens Axboe --- drivers/ata/ahci_ceva.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c index b9802185907d..50b56cd0039d 100644 --- a/drivers/ata/ahci_ceva.c +++ b/drivers/ata/ahci_ceva.c @@ -206,11 +206,9 @@ static int ceva_ahci_probe(struct platform_device *pdev) cevapriv->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); - if (IS_ERR(cevapriv->rst)) { - if (PTR_ERR(cevapriv->rst) != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to get reset: %ld\n", - PTR_ERR(cevapriv->rst)); - } + if (IS_ERR(cevapriv->rst)) + dev_err_probe(&pdev->dev, PTR_ERR(cevapriv->rst), + "failed to get reset\n"); hpriv = ahci_platform_get_resources(pdev, 0); if (IS_ERR(hpriv)) -- cgit v1.2.3 From 426e2c6a2c383c9b1f9c74b7815252da89b3b8ab Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 21 Mar 2021 20:55:22 +0100 Subject: pata_legacy: Properly document module parameters Most pata_legacy module parameters lack MODULE_PARM_DESC documentation and none is described in kernel-parameters.txt. Also several comments are inaccurate or wrong. Add the missing documentation pieces then and reorder parameters into a consistent block. Remove inaccuracies as follows: - `all' affects primary and secondary port ranges only rather than all, - `probe_all' affects tertiary and further port ranges rather than all, - `ht6560b' is for HT 6560B rather than HT 6560A. Signed-off-by: Maciej W. Rozycki Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/alpine.DEB.2.21.2103211909560.21463@angie.orcam.me.uk Signed-off-by: Jens Axboe --- Documentation/admin-guide/kernel-parameters.txt | 72 +++++++++++++++++++ drivers/ata/pata_legacy.c | 92 +++++++++++++++---------- 2 files changed, 128 insertions(+), 36 deletions(-) (limited to 'drivers') diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 04545725f187..d159503223b8 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3592,6 +3592,78 @@ Currently this function knows 686a and 8231 chips. Format: [spp|ps2|epp|ecp|ecpepp] + pata_legacy.all= [HW,LIBATA] + Format: + Set to non-zero to probe primary and secondary ISA + port ranges on PCI systems where no PCI PATA device + has been found at either range. Disabled by default. + + pata_legacy.autospeed= [HW,LIBATA] + Format: + Set to non-zero if a chip is present that snoops speed + changes. Disabled by default. + + pata_legacy.ht6560a= [HW,LIBATA] + Format: + Set to 1, 2, or 3 for HT 6560A on the primary channel, + the secondary channel, or both channels respectively. + Disabled by default. + + pata_legacy.ht6560b= [HW,LIBATA] + Format: + Set to 1, 2, or 3 for HT 6560B on the primary channel, + the secondary channel, or both channels respectively. + Disabled by default. + + pata_legacy.iordy_mask= [HW,LIBATA] + Format: + IORDY enable mask. Set individual bits to allow IORDY + for the respective channel. Bit 0 is for the first + legacy channel handled by this driver, bit 1 is for + the second channel, and so on. The sequence will often + correspond to the primary legacy channel, the secondary + legacy channel, and so on, but the handling of a PCI + bus and the use of other driver options may interfere + with the sequence. By default IORDY is allowed across + all channels. + + pata_legacy.opti82c46x= [HW,LIBATA] + Format: + Set to 1, 2, or 3 for Opti 82c611A on the primary + channel, the secondary channel, or both channels + respectively. Disabled by default. + + pata_legacy.opti82c611a= [HW,LIBATA] + Format: + Set to 1, 2, or 3 for Opti 82c465MV on the primary + channel, the secondary channel, or both channels + respectively. Disabled by default. + + pata_legacy.pio_mask= [HW,LIBATA] + Format: + PIO mode mask for autospeed devices. Set individual + bits to allow the use of the respective PIO modes. + Bit 0 is for mode 0, bit 1 is for mode 1, and so on. + All modes allowed by default. + + pata_legacy.probe_all= [HW,LIBATA] + Format: + Set to non-zero to probe tertiary and further ISA + port ranges on PCI systems. Disabled by default. + + pata_legacy.qdi= [HW,LIBATA] + Format: + Set to non-zero to probe QDI controllers. By default + set to 1 if CONFIG_PATA_QDI_MODULE, 0 otherwise. + + pata_legacy.winbond= [HW,LIBATA] + Format: + Set to non-zero to probe Winbond controllers. Use + the standard I/O port (0x130) if 1, otherwise the + value given is the I/O port to use (typically 0x1b0). + By default set to 1 if CONFIG_PATA_WINBOND_VLB_MODULE, + 0 otherwise. + pause_on_oops= Halt all CPUs after the first oops has been printed for the specified number of seconds. This is to be used if diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index a7235bde6ae8..7d59ffbe6f0a 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -63,7 +63,62 @@ static int all; module_param(all, int, 0444); -MODULE_PARM_DESC(all, "Grab all legacy port devices, even if PCI(0=off, 1=on)"); +MODULE_PARM_DESC(all, + "Set to probe unclaimed pri/sec ISA port ranges even if PCI"); + +static int probe_all; +module_param(probe_all, int, 0); +MODULE_PARM_DESC(probe_all, + "Set to probe tertiary+ ISA port ranges even if PCI"); + +static int autospeed; +module_param(autospeed, int, 0); +MODULE_PARM_DESC(autospeed, "Chip present that snoops speed changes"); + +static int pio_mask = ATA_PIO4; +module_param(pio_mask, int, 0); +MODULE_PARM_DESC(pio_mask, "PIO range for autospeed devices"); + +static int iordy_mask = 0xFFFFFFFF; +module_param(iordy_mask, int, 0); +MODULE_PARM_DESC(iordy_mask, "Use IORDY if available"); + +static int ht6560a; +module_param(ht6560a, int, 0); +MODULE_PARM_DESC(ht6560a, "HT 6560A on primary 1, second 2, both 3"); + +static int ht6560b; +module_param(ht6560b, int, 0); +MODULE_PARM_DESC(ht6560b, "HT 6560B on primary 1, secondary 2, both 3"); + +static int opti82c611a; +module_param(opti82c611a, int, 0); +MODULE_PARM_DESC(opti82c611a, + "Opti 82c611A on primary 1, secondary 2, both 3"); + +static int opti82c46x; +module_param(opti82c46x, int, 0); +MODULE_PARM_DESC(opti82c46x, + "Opti 82c465MV on primary 1, secondary 2, both 3"); + +#ifdef CONFIG_PATA_QDI_MODULE +static int qdi = 1; +#else +static int qdi; +#endif +module_param(qdi, int, 0); +MODULE_PARM_DESC(qdi, "Set to probe QDI controllers"); + +#ifdef CONFIG_PATA_WINBOND_VLB_MODULE +static int winbond = 1; +#else +static int winbond; +#endif +module_param(winbond, int, 0); +MODULE_PARM_DESC(winbond, + "Set to probe Winbond controllers, " + "give I/O port if non standard"); + enum controller { BIOS = 0, @@ -117,30 +172,6 @@ static struct ata_host *legacy_host[NR_HOST]; static int nr_legacy_host; -static int probe_all; /* Set to check all ISA port ranges */ -static int ht6560a; /* HT 6560A on primary 1, second 2, both 3 */ -static int ht6560b; /* HT 6560A on primary 1, second 2, both 3 */ -static int opti82c611a; /* Opti82c611A on primary 1, sec 2, both 3 */ -static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */ -static int autospeed; /* Chip present which snoops speed changes */ -static int pio_mask = ATA_PIO4; /* PIO range for autospeed devices */ -static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ - -/* Set to probe QDI controllers */ -#ifdef CONFIG_PATA_QDI_MODULE -static int qdi = 1; -#else -static int qdi; -#endif - -#ifdef CONFIG_PATA_WINBOND_VLB_MODULE -static int winbond = 1; /* Set to probe Winbond controllers, - give I/O port if non standard */ -#else -static int winbond; /* Set to probe Winbond controllers, - give I/O port if non standard */ -#endif - /** * legacy_probe_add - Add interface to probe list * @port: Controller port @@ -1250,16 +1281,5 @@ MODULE_VERSION(DRV_VERSION); MODULE_ALIAS("pata_qdi"); MODULE_ALIAS("pata_winbond"); -module_param(probe_all, int, 0); -module_param(autospeed, int, 0); -module_param(ht6560a, int, 0); -module_param(ht6560b, int, 0); -module_param(opti82c611a, int, 0); -module_param(opti82c46x, int, 0); -module_param(qdi, int, 0); -module_param(winbond, int, 0); -module_param(pio_mask, int, 0); -module_param(iordy_mask, int, 0); - module_init(legacy_init); module_exit(legacy_exit); -- cgit v1.2.3 From 6ddcec9547f64f01186e76e29d67e193b52ac30f Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 21 Mar 2021 20:55:27 +0100 Subject: pata_platform: Document `pio_mask' module parameter Add MODULE_PARM_DESC documentation and a kernel-parameters.txt entry. Signed-off-by: Maciej W. Rozycki Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/alpine.DEB.2.21.2103212023190.21463@angie.orcam.me.uk Signed-off-by: Jens Axboe --- Documentation/admin-guide/kernel-parameters.txt | 7 +++++++ drivers/ata/pata_platform.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index d159503223b8..011129133b7a 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3664,6 +3664,13 @@ By default set to 1 if CONFIG_PATA_WINBOND_VLB_MODULE, 0 otherwise. + pata_platform.pio_mask= [HW,LIBATA] + Format: + Supported PIO mode mask. Set individual bits to allow + the use of the respective PIO modes. Bit 0 is for + mode 0, bit 1 is for mode 1, and so on. Mode 0 only + allowed by default. + pause_on_oops= Halt all CPUs after the first oops has been printed for the specified number of seconds. This is to be used if diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 5aba691f09af..028329428b75 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c @@ -24,6 +24,8 @@ #define DRV_VERSION "1.2" static int pio_mask = 1; +module_param(pio_mask, int, 0); +MODULE_PARM_DESC(pio_mask, "PIO modes supported, mode 0 only by default"); /* * Provide our own set_mode() as we don't want to change anything that has @@ -233,8 +235,6 @@ static struct platform_driver pata_platform_driver = { module_platform_driver(pata_platform_driver); -module_param(pio_mask, int, 0); - MODULE_AUTHOR("Paul Mundt"); MODULE_DESCRIPTION("low-level driver for platform device ATA"); MODULE_LICENSE("GPL"); -- cgit v1.2.3 From 7d33004d24dafeedb95b85a271a37aa33678ac0b Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 21 Mar 2021 20:55:32 +0100 Subject: pata_legacy: Add `probe_mask' parameter like with ide-generic Carry the `probe_mask' parameter over from ide-generic to pata_legacy so that there is a way to prevent random poking at ISA port I/O locations in attempt to discover adapter option cards with libata like with the old IDE driver. By default all enabled locations are tried, however it may interfere with a different kind of hardware responding there. For example with a plain (E)ISA system the driver tries all the six possible locations: scsi host0: pata_legacy ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14 ata1.00: ATA-4: ST310211A, 3.54, max UDMA/100 ata1.00: 19541088 sectors, multi 16: LBA ata1.00: configured for PIO scsi 0:0:0:0: Direct-Access ATA ST310211A 3.54 PQ: 0 ANSI: 5 scsi 0:0:0:0: Attached scsi generic sg0 type 0 sd 0:0:0:0: [sda] 19541088 512-byte logical blocks: (10.0 GB/9.32 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sda2 sda3 sd 0:0:0:0: [sda] Attached SCSI disk scsi host1: pata_legacy ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15 scsi host1: pata_legacy ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11 scsi host1: pata_legacy ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10 scsi host1: pata_legacy ata5: PATA max PIO4 cmd 0x1e0 ctl 0x3e6 irq 8 scsi host1: pata_legacy ata6: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12 however giving the kernel "pata_legacy.probe_mask=21" makes it try every other location only: scsi host0: pata_legacy ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14 ata1.00: ATA-4: ST310211A, 3.54, max UDMA/100 ata1.00: 19541088 sectors, multi 16: LBA ata1.00: configured for PIO scsi 0:0:0:0: Direct-Access ATA ST310211A 3.54 PQ: 0 ANSI: 5 scsi 0:0:0:0: Attached scsi generic sg0 type 0 sd 0:0:0:0: [sda] 19541088 512-byte logical blocks: (10.0 GB/9.32 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sda2 sda3 sd 0:0:0:0: [sda] Attached SCSI disk scsi host1: pata_legacy ata2: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11 scsi host1: pata_legacy ata3: PATA max PIO4 cmd 0x1e0 ctl 0x3e6 irq 8 Signed-off-by: Maciej W. Rozycki Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/alpine.DEB.2.21.2103211800110.21463@angie.orcam.me.uk Signed-off-by: Jens Axboe --- Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++ drivers/ata/pata_legacy.c | 6 ++++++ 2 files changed, 17 insertions(+) (limited to 'drivers') diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 011129133b7a..fcd0fc8fd977 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3651,6 +3651,17 @@ Set to non-zero to probe tertiary and further ISA port ranges on PCI systems. Disabled by default. + pata_legacy.probe_mask= [HW,LIBATA] + Format: + Probe mask for legacy ISA PATA ports. Depending on + platform configuration and the use of other driver + options up to 6 legacy ports are supported: 0x1f0, + 0x170, 0x1e8, 0x168, 0x1e0, 0x160, however probing + of individual ports can be disabled by setting the + corresponding bits in the mask to 1. Bit 0 is for + the first port in the list above (0x1f0), and so on. + By default all supported ports are probed. + pata_legacy.qdi= [HW,LIBATA] Format: Set to non-zero to probe QDI controllers. By default diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 7d59ffbe6f0a..c3e6592712c4 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -71,6 +71,10 @@ module_param(probe_all, int, 0); MODULE_PARM_DESC(probe_all, "Set to probe tertiary+ ISA port ranges even if PCI"); +static int probe_mask = ~0; +module_param(probe_mask, int, 0); +MODULE_PARM_DESC(probe_mask, "Probe mask for legacy ISA PATA ports"); + static int autospeed; module_param(autospeed, int, 0); MODULE_PARM_DESC(autospeed, "Chip present that snoops speed changes"); @@ -199,6 +203,8 @@ static int legacy_probe_add(unsigned long port, unsigned int irq, free = lp; /* Matching port, or the correct slot for ordering */ if (lp->port == port || legacy_port[i] == port) { + if (!(probe_mask & 1 << i)) + return -1; free = lp; break; } -- cgit v1.2.3 From 868ed7311cd81ef2fffa2cd36e72c44f226b0085 Mon Sep 17 00:00:00 2001 From: Sowjanya Komatineni Date: Tue, 6 Apr 2021 18:25:31 -0700 Subject: ata: ahci_tegra: Add AHCI support for Tegra186 This patch adds support for AHCI-compliant Serial ATA controller on Tegra186 SoC. Tegra186 does not have sata-oob reset. Tegra186 SATA_NVOOB register filed COMMA_CNT position and width are different compared to Tegra210 and prior. So, this patch adds a flag has_sata_oob_rst and tegra_ahci_regs to SoC specific strcuture tegra_ahci_soc and updated their implementation accordingly. Signed-off-by: Sowjanya Komatineni Acked-by: Thierry Reding Link: https://lore.kernel.org/r/1617758731-12380-4-git-send-email-skomatineni@nvidia.com Signed-off-by: Jens Axboe --- drivers/ata/ahci_tegra.c | 60 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c index cb55ebc1725b..56612af16db0 100644 --- a/drivers/ata/ahci_tegra.c +++ b/drivers/ata/ahci_tegra.c @@ -59,8 +59,6 @@ #define T_SATA0_CFG_PHY_1_PAD_PLL_IDDQ_EN BIT(22) #define T_SATA0_NVOOB 0x114 -#define T_SATA0_NVOOB_COMMA_CNT_MASK (0xff << 16) -#define T_SATA0_NVOOB_COMMA_CNT (0x07 << 16) #define T_SATA0_NVOOB_SQUELCH_FILTER_MODE_MASK (0x3 << 24) #define T_SATA0_NVOOB_SQUELCH_FILTER_MODE (0x1 << 24) #define T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH_MASK (0x3 << 26) @@ -154,11 +152,18 @@ struct tegra_ahci_ops { int (*init)(struct ahci_host_priv *hpriv); }; +struct tegra_ahci_regs { + unsigned int nvoob_comma_cnt_mask; + unsigned int nvoob_comma_cnt_val; +}; + struct tegra_ahci_soc { const char *const *supply_names; u32 num_supplies; bool supports_devslp; + bool has_sata_oob_rst; const struct tegra_ahci_ops *ops; + const struct tegra_ahci_regs *regs; }; struct tegra_ahci_priv { @@ -240,11 +245,13 @@ static int tegra_ahci_power_on(struct ahci_host_priv *hpriv) if (ret) return ret; - ret = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_SATA, - tegra->sata_clk, - tegra->sata_rst); - if (ret) - goto disable_regulators; + if (!tegra->pdev->dev.pm_domain) { + ret = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_SATA, + tegra->sata_clk, + tegra->sata_rst); + if (ret) + goto disable_regulators; + } reset_control_assert(tegra->sata_oob_rst); reset_control_assert(tegra->sata_cold_rst); @@ -330,10 +337,10 @@ static int tegra_ahci_controller_init(struct ahci_host_priv *hpriv) writel(val, tegra->sata_regs + SCFG_OFFSET + T_SATA_CFG_PHY_0); val = readl(tegra->sata_regs + SCFG_OFFSET + T_SATA0_NVOOB); - val &= ~(T_SATA0_NVOOB_COMMA_CNT_MASK | + val &= ~(tegra->soc->regs->nvoob_comma_cnt_mask | T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH_MASK | T_SATA0_NVOOB_SQUELCH_FILTER_MODE_MASK); - val |= (T_SATA0_NVOOB_COMMA_CNT | + val |= (tegra->soc->regs->nvoob_comma_cnt_val | T_SATA0_NVOOB_SQUELCH_FILTER_LENGTH | T_SATA0_NVOOB_SQUELCH_FILTER_MODE); writel(val, tegra->sata_regs + SCFG_OFFSET + T_SATA0_NVOOB); @@ -449,15 +456,35 @@ static const struct tegra_ahci_ops tegra124_ahci_ops = { .init = tegra124_ahci_init, }; +static const struct tegra_ahci_regs tegra124_ahci_regs = { + .nvoob_comma_cnt_mask = GENMASK(30, 28), + .nvoob_comma_cnt_val = (7 << 28), +}; + static const struct tegra_ahci_soc tegra124_ahci_soc = { .supply_names = tegra124_supply_names, .num_supplies = ARRAY_SIZE(tegra124_supply_names), .supports_devslp = false, + .has_sata_oob_rst = true, .ops = &tegra124_ahci_ops, + .regs = &tegra124_ahci_regs, }; static const struct tegra_ahci_soc tegra210_ahci_soc = { .supports_devslp = false, + .has_sata_oob_rst = true, + .regs = &tegra124_ahci_regs, +}; + +static const struct tegra_ahci_regs tegra186_ahci_regs = { + .nvoob_comma_cnt_mask = GENMASK(23, 16), + .nvoob_comma_cnt_val = (7 << 16), +}; + +static const struct tegra_ahci_soc tegra186_ahci_soc = { + .supports_devslp = false, + .has_sata_oob_rst = false, + .regs = &tegra186_ahci_regs, }; static const struct of_device_id tegra_ahci_of_match[] = { @@ -469,6 +496,10 @@ static const struct of_device_id tegra_ahci_of_match[] = { .compatible = "nvidia,tegra210-ahci", .data = &tegra210_ahci_soc }, + { + .compatible = "nvidia,tegra186-ahci", + .data = &tegra186_ahci_soc + }, {} }; MODULE_DEVICE_TABLE(of, tegra_ahci_of_match); @@ -518,10 +549,13 @@ static int tegra_ahci_probe(struct platform_device *pdev) return PTR_ERR(tegra->sata_rst); } - tegra->sata_oob_rst = devm_reset_control_get(&pdev->dev, "sata-oob"); - if (IS_ERR(tegra->sata_oob_rst)) { - dev_err(&pdev->dev, "Failed to get sata-oob reset\n"); - return PTR_ERR(tegra->sata_oob_rst); + if (tegra->soc->has_sata_oob_rst) { + tegra->sata_oob_rst = devm_reset_control_get(&pdev->dev, + "sata-oob"); + if (IS_ERR(tegra->sata_oob_rst)) { + dev_err(&pdev->dev, "Failed to get sata-oob reset\n"); + return PTR_ERR(tegra->sata_oob_rst); + } } tegra->sata_cold_rst = devm_reset_control_get(&pdev->dev, "sata-cold"); -- cgit v1.2.3 From 8b625d01fd503d08005eaff68d05a39d3e1f80e4 Mon Sep 17 00:00:00 2001 From: Sowjanya Komatineni Date: Thu, 8 Apr 2021 13:55:15 -0700 Subject: ata: ahci_tegra: call tegra_powergate_power_off only when PM domain is not present This patch adds check to call legacy power domain API tegra_powergate_power_off() only when PM domain is not present. Fixes: 868ed7311cd8 ("ata: ahci_tegra: Add AHCI support for Tegra186") Reviewed-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/1617915315-13639-2-git-send-email-skomatineni@nvidia.com Signed-off-by: Sowjanya Komatineni Signed-off-by: Jens Axboe --- drivers/ata/ahci_tegra.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c index 56612af16db0..4fb94db1217d 100644 --- a/drivers/ata/ahci_tegra.c +++ b/drivers/ata/ahci_tegra.c @@ -268,7 +268,8 @@ static int tegra_ahci_power_on(struct ahci_host_priv *hpriv) disable_power: clk_disable_unprepare(tegra->sata_clk); - tegra_powergate_power_off(TEGRA_POWERGATE_SATA); + if (!tegra->pdev->dev.pm_domain) + tegra_powergate_power_off(TEGRA_POWERGATE_SATA); disable_regulators: regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); @@ -287,7 +288,8 @@ static void tegra_ahci_power_off(struct ahci_host_priv *hpriv) reset_control_assert(tegra->sata_cold_rst); clk_disable_unprepare(tegra->sata_clk); - tegra_powergate_power_off(TEGRA_POWERGATE_SATA); + if (!tegra->pdev->dev.pm_domain) + tegra_powergate_power_off(TEGRA_POWERGATE_SATA); regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); } -- cgit v1.2.3 From c38ae56ee034623c59e39c0130ca0dec086c1a39 Mon Sep 17 00:00:00 2001 From: Junlin Yang Date: Fri, 9 Apr 2021 21:54:26 +0800 Subject: pata_ipx4xx_cf: Fix unsigned comparison with less than zero The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format. ./drivers/ata/pata_ixp4xx_cf.c:168:5-8: WARNING: Unsigned expression compared with zero: irq > 0 Signed-off-by: Junlin Yang Link: https://lore.kernel.org/r/20210409135426.1773-1-angkery@163.com Signed-off-by: Jens Axboe --- drivers/ata/pata_ixp4xx_cf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index abc0e87ca1a8..43215a4c1e54 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c @@ -135,12 +135,12 @@ static void ixp4xx_setup_port(struct ata_port *ap, static int ixp4xx_pata_probe(struct platform_device *pdev) { - unsigned int irq; struct resource *cs0, *cs1; struct ata_host *host; struct ata_port *ap; struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev); int ret; + int irq; cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); -- cgit v1.2.3 From e06abcc68cb555377efd5aa781c014d3d68498b6 Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Tue, 20 Apr 2021 15:11:29 -0500 Subject: libata: Fix fall-through warnings for Clang In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe --- drivers/ata/libata-eh.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index b6f92050e60c..2db1e9c66088 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -2613,6 +2613,7 @@ int ata_eh_reset(struct ata_link *link, int classify, switch (tmp) { case -EAGAIN: rc = -EAGAIN; + break; case 0: break; default: -- cgit v1.2.3