hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ata/sata_mv.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * sata_mv.c - Marvell SATA support
34 *
....@@ -9,20 +10,6 @@
910 * Extensive overhaul and enhancement by Mark Lord <mlord@pobox.com>.
1011 *
1112 * Please ALWAYS copy linux-ide@vger.kernel.org on emails.
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; version 2 of the License.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; if not, write to the Free Software
24
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
- *
2613 */
2714
2815 /*
....@@ -2023,7 +2010,7 @@
20232010 break;
20242011 case ATA_CMD_WRITE_MULTI_FUA_EXT:
20252012 tf->flags &= ~ATA_TFLAG_FUA; /* ugh */
2026
- /* fall through */
2013
+ fallthrough;
20272014 case ATA_CMD_WRITE_MULTI_EXT:
20282015 tf->command = ATA_CMD_PIO_WRITE_EXT;
20292016 break;
....@@ -2057,7 +2044,7 @@
20572044 case ATA_PROT_DMA:
20582045 if (tf->command == ATA_CMD_DSM)
20592046 return AC_ERR_OK;
2060
- /* fall-thru */
2047
+ fallthrough;
20612048 case ATA_PROT_NCQ:
20622049 break; /* continue below */
20632050 case ATA_PROT_PIO:
....@@ -2309,7 +2296,7 @@
23092296 switch (qc->tf.protocol) {
23102297 case ATAPI_PROT_PIO:
23112298 pp->pp_flags |= MV_PP_FLAG_FAKE_ATA_BUSY;
2312
- /* fall through */
2299
+ fallthrough;
23132300 case ATAPI_PROT_NODATA:
23142301 ap->hsm_task_state = HSM_ST_FIRST;
23152302 break;
....@@ -2360,7 +2347,7 @@
23602347 return AC_ERR_OTHER;
23612348 break; /* use bmdma for this */
23622349 }
2363
- /* fall thru */
2350
+ fallthrough;
23642351 case ATA_PROT_NCQ:
23652352 mv_start_edma(ap, port_mmio, pp, qc->tf.protocol);
23662353 pp->req_idx = (pp->req_idx + 1) & MV_MAX_Q_DEPTH_MASK;
....@@ -2389,7 +2376,7 @@
23892376 ": attempting PIO w/multiple DRQ: "
23902377 "this may fail due to h/w errata\n");
23912378 }
2392
- /* fall through */
2379
+ fallthrough;
23932380 case ATA_PROT_NODATA:
23942381 case ATAPI_PROT_PIO:
23952382 case ATAPI_PROT_NODATA:
....@@ -3877,7 +3864,7 @@
38773864 " and avoid the final two gigabytes on"
38783865 " all RocketRAID BIOS initialized drives.\n");
38793866 }
3880
- /* fall through */
3867
+ fallthrough;
38813868 case chip_6042:
38823869 hpriv->ops = &mv6xxx_ops;
38833870 hp_flags |= MV_HP_GEN_IIE;
....@@ -4333,38 +4320,6 @@
43334320
43344321 };
43354322
4336
-/* move to PCI layer or libata core? */
4337
-static int pci_go_64(struct pci_dev *pdev)
4338
-{
4339
- int rc;
4340
-
4341
- if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
4342
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
4343
- if (rc) {
4344
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
4345
- if (rc) {
4346
- dev_err(&pdev->dev,
4347
- "64-bit DMA enable failed\n");
4348
- return rc;
4349
- }
4350
- }
4351
- } else {
4352
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
4353
- if (rc) {
4354
- dev_err(&pdev->dev, "32-bit DMA enable failed\n");
4355
- return rc;
4356
- }
4357
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
4358
- if (rc) {
4359
- dev_err(&pdev->dev,
4360
- "32-bit consistent DMA enable failed\n");
4361
- return rc;
4362
- }
4363
- }
4364
-
4365
- return rc;
4366
-}
4367
-
43684323 /**
43694324 * mv_print_info - Dump key info to kernel log for perusal.
43704325 * @host: ATA host to print info about
....@@ -4449,9 +4404,11 @@
44494404 host->iomap = pcim_iomap_table(pdev);
44504405 hpriv->base = host->iomap[MV_PRIMARY_BAR];
44514406
4452
- rc = pci_go_64(pdev);
4453
- if (rc)
4407
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
4408
+ if (rc) {
4409
+ dev_err(&pdev->dev, "DMA enable failed\n");
44544410 return rc;
4411
+ }
44554412
44564413 rc = mv_create_dma_pools(hpriv, &pdev->dev);
44574414 if (rc)