Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e269fe3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Revert "sd: Fix rw_max for devices that report an optimal xfer size""

parents 5915565f c60b0506
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2792,10 +2792,10 @@ static int sd_revalidate_disk(struct gendisk *disk)
	if (sdkp->opt_xfer_blocks &&
	    sdkp->opt_xfer_blocks <= dev_max &&
	    sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS &&
	    logical_to_bytes(sdp, sdkp->opt_xfer_blocks) >= PAGE_SIZE) {
		q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
		rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
	} else
	    sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE)
		rw_max = q->limits.io_opt =
			sdkp->opt_xfer_blocks * sdp->sector_size;
	else
		rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
				      (sector_t)BLK_DEF_MAX_SECTORS);

+0 −5
Original line number Diff line number Diff line
@@ -151,11 +151,6 @@ static inline sector_t logical_to_sectors(struct scsi_device *sdev, sector_t blo
	return blocks << (ilog2(sdev->sector_size) - 9);
}

static inline unsigned int logical_to_bytes(struct scsi_device *sdev, sector_t blocks)
{
	return blocks * sdev->sector_size;
}

/*
 * Look up the DIX operation based on whether the command is read or
 * write and whether dix and dif are enabled.