.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * sata_mv.c - Marvell SATA support |
---|
3 | 4 | * |
---|
.. | .. |
---|
9 | 10 | * Extensive overhaul and enhancement by Mark Lord <mlord@pobox.com>. |
---|
10 | 11 | * |
---|
11 | 12 | * 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 | | - * |
---|
26 | 13 | */ |
---|
27 | 14 | |
---|
28 | 15 | /* |
---|
.. | .. |
---|
2023 | 2010 | break; |
---|
2024 | 2011 | case ATA_CMD_WRITE_MULTI_FUA_EXT: |
---|
2025 | 2012 | tf->flags &= ~ATA_TFLAG_FUA; /* ugh */ |
---|
2026 | | - /* fall through */ |
---|
| 2013 | + fallthrough; |
---|
2027 | 2014 | case ATA_CMD_WRITE_MULTI_EXT: |
---|
2028 | 2015 | tf->command = ATA_CMD_PIO_WRITE_EXT; |
---|
2029 | 2016 | break; |
---|
.. | .. |
---|
2057 | 2044 | case ATA_PROT_DMA: |
---|
2058 | 2045 | if (tf->command == ATA_CMD_DSM) |
---|
2059 | 2046 | return AC_ERR_OK; |
---|
2060 | | - /* fall-thru */ |
---|
| 2047 | + fallthrough; |
---|
2061 | 2048 | case ATA_PROT_NCQ: |
---|
2062 | 2049 | break; /* continue below */ |
---|
2063 | 2050 | case ATA_PROT_PIO: |
---|
.. | .. |
---|
2309 | 2296 | switch (qc->tf.protocol) { |
---|
2310 | 2297 | case ATAPI_PROT_PIO: |
---|
2311 | 2298 | pp->pp_flags |= MV_PP_FLAG_FAKE_ATA_BUSY; |
---|
2312 | | - /* fall through */ |
---|
| 2299 | + fallthrough; |
---|
2313 | 2300 | case ATAPI_PROT_NODATA: |
---|
2314 | 2301 | ap->hsm_task_state = HSM_ST_FIRST; |
---|
2315 | 2302 | break; |
---|
.. | .. |
---|
2360 | 2347 | return AC_ERR_OTHER; |
---|
2361 | 2348 | break; /* use bmdma for this */ |
---|
2362 | 2349 | } |
---|
2363 | | - /* fall thru */ |
---|
| 2350 | + fallthrough; |
---|
2364 | 2351 | case ATA_PROT_NCQ: |
---|
2365 | 2352 | mv_start_edma(ap, port_mmio, pp, qc->tf.protocol); |
---|
2366 | 2353 | pp->req_idx = (pp->req_idx + 1) & MV_MAX_Q_DEPTH_MASK; |
---|
.. | .. |
---|
2389 | 2376 | ": attempting PIO w/multiple DRQ: " |
---|
2390 | 2377 | "this may fail due to h/w errata\n"); |
---|
2391 | 2378 | } |
---|
2392 | | - /* fall through */ |
---|
| 2379 | + fallthrough; |
---|
2393 | 2380 | case ATA_PROT_NODATA: |
---|
2394 | 2381 | case ATAPI_PROT_PIO: |
---|
2395 | 2382 | case ATAPI_PROT_NODATA: |
---|
.. | .. |
---|
3877 | 3864 | " and avoid the final two gigabytes on" |
---|
3878 | 3865 | " all RocketRAID BIOS initialized drives.\n"); |
---|
3879 | 3866 | } |
---|
3880 | | - /* fall through */ |
---|
| 3867 | + fallthrough; |
---|
3881 | 3868 | case chip_6042: |
---|
3882 | 3869 | hpriv->ops = &mv6xxx_ops; |
---|
3883 | 3870 | hp_flags |= MV_HP_GEN_IIE; |
---|
.. | .. |
---|
4333 | 4320 | |
---|
4334 | 4321 | }; |
---|
4335 | 4322 | |
---|
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 | | - |
---|
4368 | 4323 | /** |
---|
4369 | 4324 | * mv_print_info - Dump key info to kernel log for perusal. |
---|
4370 | 4325 | * @host: ATA host to print info about |
---|
.. | .. |
---|
4449 | 4404 | host->iomap = pcim_iomap_table(pdev); |
---|
4450 | 4405 | hpriv->base = host->iomap[MV_PRIMARY_BAR]; |
---|
4451 | 4406 | |
---|
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"); |
---|
4454 | 4410 | return rc; |
---|
| 4411 | + } |
---|
4455 | 4412 | |
---|
4456 | 4413 | rc = mv_create_dma_pools(hpriv, &pdev->dev); |
---|
4457 | 4414 | if (rc) |
---|