| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * libata-sff.c - helper library for PCI IDE BMDMA |
|---|
| 3 | 4 | * |
|---|
| 4 | | - * Maintained by: Tejun Heo <tj@kernel.org> |
|---|
| 5 | | - * Please ALWAYS copy linux-ide@vger.kernel.org |
|---|
| 6 | | - * on emails. |
|---|
| 7 | | - * |
|---|
| 8 | 5 | * Copyright 2003-2006 Red Hat, Inc. All rights reserved. |
|---|
| 9 | 6 | * Copyright 2003-2006 Jeff Garzik |
|---|
| 10 | | - * |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 13 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 14 | | - * the Free Software Foundation; either version 2, or (at your option) |
|---|
| 15 | | - * any later version. |
|---|
| 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; see the file COPYING. If not, write to |
|---|
| 24 | | - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 25 | | - * |
|---|
| 26 | 7 | * |
|---|
| 27 | 8 | * libata documentation is available via 'make {ps|pdf}docs', |
|---|
| 28 | 9 | * as Documentation/driver-api/libata.rst |
|---|
| 29 | 10 | * |
|---|
| 30 | 11 | * Hardware documentation available from http://www.t13.org/ and |
|---|
| 31 | 12 | * http://www.sata-io.org/ |
|---|
| 32 | | - * |
|---|
| 33 | 13 | */ |
|---|
| 34 | 14 | |
|---|
| 35 | 15 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 3192 | 3172 | * ->sff_irq_clear method. Try to initialize bmdma_addr |
|---|
| 3193 | 3173 | * regardless of dma masks. |
|---|
| 3194 | 3174 | */ |
|---|
| 3195 | | - rc = dma_set_mask(&pdev->dev, ATA_DMA_MASK); |
|---|
| 3175 | + rc = dma_set_mask_and_coherent(&pdev->dev, ATA_DMA_MASK); |
|---|
| 3196 | 3176 | if (rc) |
|---|
| 3197 | 3177 | ata_bmdma_nodma(host, "failed to set dma mask"); |
|---|
| 3198 | | - if (!rc) { |
|---|
| 3199 | | - rc = dma_set_coherent_mask(&pdev->dev, ATA_DMA_MASK); |
|---|
| 3200 | | - if (rc) |
|---|
| 3201 | | - ata_bmdma_nodma(host, |
|---|
| 3202 | | - "failed to set consistent dma mask"); |
|---|
| 3203 | | - } |
|---|
| 3204 | 3178 | |
|---|
| 3205 | 3179 | /* request and iomap DMA region */ |
|---|
| 3206 | 3180 | rc = pcim_iomap_regions(pdev, 1 << 4, dev_driver_string(gdev)); |
|---|