Commit a92041bd authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: pata_macio: Switch to using ->device_configure

Switch to the ->device_configure method instead of ->slave_configure and
update the block limits on the passed in queue_limits instead of using the
per-limit accessors.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-20-hch@lst.deReviewed-by: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3cfedd59
...@@ -796,7 +796,8 @@ static void pata_macio_reset_hw(struct pata_macio_priv *priv, int resume) ...@@ -796,7 +796,8 @@ static void pata_macio_reset_hw(struct pata_macio_priv *priv, int resume)
/* Hook the standard slave config to fixup some HW related alignment /* Hook the standard slave config to fixup some HW related alignment
* restrictions * restrictions
*/ */
static int pata_macio_slave_config(struct scsi_device *sdev) static int pata_macio_device_configure(struct scsi_device *sdev,
struct queue_limits *lim)
{ {
struct ata_port *ap = ata_shost_to_port(sdev->host); struct ata_port *ap = ata_shost_to_port(sdev->host);
struct pata_macio_priv *priv = ap->private_data; struct pata_macio_priv *priv = ap->private_data;
...@@ -814,7 +815,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev) ...@@ -814,7 +815,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev)
/* OHare has issues with non cache aligned DMA on some chipsets */ /* OHare has issues with non cache aligned DMA on some chipsets */
if (priv->kind == controller_ohare) { if (priv->kind == controller_ohare) {
blk_queue_update_dma_alignment(sdev->request_queue, 31); lim->dma_alignment = 31;
blk_queue_update_dma_pad(sdev->request_queue, 31); blk_queue_update_dma_pad(sdev->request_queue, 31);
/* Tell the world about it */ /* Tell the world about it */
...@@ -829,7 +830,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev) ...@@ -829,7 +830,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev)
/* Shasta and K2 seem to have "issues" with reads ... */ /* Shasta and K2 seem to have "issues" with reads ... */
if (priv->kind == controller_sh_ata6 || priv->kind == controller_k2_ata6) { if (priv->kind == controller_sh_ata6 || priv->kind == controller_k2_ata6) {
/* Allright these are bad, apply restrictions */ /* Allright these are bad, apply restrictions */
blk_queue_update_dma_alignment(sdev->request_queue, 15); lim->dma_alignment = 15;
blk_queue_update_dma_pad(sdev->request_queue, 15); blk_queue_update_dma_pad(sdev->request_queue, 15);
/* We enable MWI and hack cache line size directly here, this /* We enable MWI and hack cache line size directly here, this
...@@ -918,7 +919,7 @@ static const struct scsi_host_template pata_macio_sht = { ...@@ -918,7 +919,7 @@ static const struct scsi_host_template pata_macio_sht = {
* use 64K minus 256 * use 64K minus 256
*/ */
.max_segment_size = MAX_DBDMA_SEG, .max_segment_size = MAX_DBDMA_SEG,
.slave_configure = pata_macio_slave_config, .device_configure = pata_macio_device_configure,
.sdev_groups = ata_common_sdev_groups, .sdev_groups = ata_common_sdev_groups,
.can_queue = ATA_DEF_QUEUE, .can_queue = ATA_DEF_QUEUE,
.tag_alloc_policy = BLK_TAG_ALLOC_RR, .tag_alloc_policy = BLK_TAG_ALLOC_RR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment