Re: [PATCH] scsi: sd: usb_storage: uas: Access media prior to querying device properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 13, 2024 at 09:33:06AM -0500, Martin K. Petersen wrote:
> It has been observed that some USB/UAS devices return generic
> properties hardcoded in firmware for mode pages and vital product data
> for a period of time after a device has been discovered. The reported
> properties are either garbage or they do not accurately reflect the
> properties of the physical storage device attached in the case of a
> bridge.

...

> +static void sd_read_block_zero(struct scsi_disk *sdkp)
> +{
> +	unsigned int buf_len = sdkp->device->sector_size;
> +	char *buffer, cmd[10] = { };
> +
> +	buffer = kmalloc(buf_len, GFP_KERNEL);
> +	if (!buffer)
> +		return;
> +
> +	cmd[0] = READ_10;
> +	put_unaligned_be32(0, &cmd[2]); /* Logical block address 0 */
> +	put_unaligned_be16(1, &cmd[7]);	/* Transfer 1 logical block */
> +
> +	scsi_execute_cmd(sdkp->device, cmd, REQ_OP_DRV_IN, buffer, buf_len,
> +			 SD_TIMEOUT, sdkp->max_retries, NULL);
> +	kfree(buffer);
> +}

Do we still claim to support devices that implement only the 6-byte
commands, not the 10-byte forms?  Or is that now a non-issue?

Alan Stern




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux