| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * sata_inic162x.c - Driver for Initio 162x SATA controllers |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2006 SUSE Linux Products GmbH |
|---|
| 5 | 6 | * Copyright 2006 Tejun Heo <teheo@novell.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This file is released under GPL v2. |
|---|
| 8 | 7 | * |
|---|
| 9 | 8 | * **** WARNING **** |
|---|
| 10 | 9 | * |
|---|
| .. | .. |
|---|
| 146 | 145 | |
|---|
| 147 | 146 | /* PORT_IDMA_CTL bits */ |
|---|
| 148 | 147 | IDMA_CTL_RST_ATA = (1 << 2), /* hardreset ATA bus */ |
|---|
| 149 | | - IDMA_CTL_RST_IDMA = (1 << 5), /* reset IDMA machinary */ |
|---|
| 148 | + IDMA_CTL_RST_IDMA = (1 << 5), /* reset IDMA machinery */ |
|---|
| 150 | 149 | IDMA_CTL_GO = (1 << 7), /* IDMA mode go */ |
|---|
| 151 | 150 | IDMA_CTL_ATA_NIEN = (1 << 8), /* ATA IRQ disable */ |
|---|
| 152 | 151 | |
|---|
| .. | .. |
|---|
| 245 | 244 | |
|---|
| 246 | 245 | static struct scsi_host_template inic_sht = { |
|---|
| 247 | 246 | ATA_BASE_SHT(DRV_NAME), |
|---|
| 248 | | - .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */ |
|---|
| 249 | | - .dma_boundary = INIC_DMA_BOUNDARY, |
|---|
| 247 | + .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */ |
|---|
| 248 | + |
|---|
| 249 | + /* |
|---|
| 250 | + * This controller is braindamaged. dma_boundary is 0xffff like others |
|---|
| 251 | + * but it will lock up the whole machine HARD if 65536 byte PRD entry |
|---|
| 252 | + * is fed. Reduce maximum segment size. |
|---|
| 253 | + */ |
|---|
| 254 | + .dma_boundary = INIC_DMA_BOUNDARY, |
|---|
| 255 | + .max_segment_size = 65536 - 512, |
|---|
| 250 | 256 | }; |
|---|
| 251 | 257 | |
|---|
| 252 | 258 | static const int scr_map[] = { |
|---|
| .. | .. |
|---|
| 858 | 864 | } |
|---|
| 859 | 865 | |
|---|
| 860 | 866 | /* Set dma_mask. This devices doesn't support 64bit addressing. */ |
|---|
| 861 | | - rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); |
|---|
| 867 | + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
|---|
| 862 | 868 | if (rc) { |
|---|
| 863 | 869 | dev_err(&pdev->dev, "32-bit DMA enable failed\n"); |
|---|
| 864 | | - return rc; |
|---|
| 865 | | - } |
|---|
| 866 | | - |
|---|
| 867 | | - rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); |
|---|
| 868 | | - if (rc) { |
|---|
| 869 | | - dev_err(&pdev->dev, "32-bit consistent DMA enable failed\n"); |
|---|
| 870 | | - return rc; |
|---|
| 871 | | - } |
|---|
| 872 | | - |
|---|
| 873 | | - /* |
|---|
| 874 | | - * This controller is braindamaged. dma_boundary is 0xffff |
|---|
| 875 | | - * like others but it will lock up the whole machine HARD if |
|---|
| 876 | | - * 65536 byte PRD entry is fed. Reduce maximum segment size. |
|---|
| 877 | | - */ |
|---|
| 878 | | - rc = pci_set_dma_max_seg_size(pdev, 65536 - 512); |
|---|
| 879 | | - if (rc) { |
|---|
| 880 | | - dev_err(&pdev->dev, "failed to set the maximum segment size\n"); |
|---|
| 881 | 870 | return rc; |
|---|
| 882 | 871 | } |
|---|
| 883 | 872 | |
|---|