sdkp 123 drivers/scsi/sd.c static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); sdkp 144 drivers/scsi/sd.c static void sd_set_flush_flag(struct scsi_disk *sdkp) sdkp 148 drivers/scsi/sd.c if (sdkp->WCE) { sdkp 150 drivers/scsi/sd.c if (sdkp->DPOFUA) sdkp 154 drivers/scsi/sd.c blk_queue_write_cache(sdkp->disk->queue, wc, fua); sdkp 162 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 163 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 179 drivers/scsi/sd.c sdkp->cache_override = 1; sdkp 181 drivers/scsi/sd.c sdkp->cache_override = 0; sdkp 189 drivers/scsi/sd.c wce = (ct & 0x02) && !sdkp->write_prot ? 1 : 0; sdkp 191 drivers/scsi/sd.c if (sdkp->cache_override) { sdkp 192 drivers/scsi/sd.c sdkp->WCE = wce; sdkp 193 drivers/scsi/sd.c sdkp->RCD = rcd; sdkp 194 drivers/scsi/sd.c sd_set_flush_flag(sdkp); sdkp 219 drivers/scsi/sd.c sd_print_sense_hdr(sdkp, &sshdr); sdkp 222 drivers/scsi/sd.c revalidate_disk(sdkp->disk); sdkp 230 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 231 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 240 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 241 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 259 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 261 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->device->allow_restart); sdkp 269 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 270 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 290 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 291 drivers/scsi/sd.c int ct = sdkp->RCD + 2*sdkp->WCE; sdkp 300 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 302 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->DPOFUA); sdkp 310 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 312 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->protection_type); sdkp 319 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 332 drivers/scsi/sd.c sdkp->protection_type = val; sdkp 342 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 343 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 346 drivers/scsi/sd.c dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type); sdkp 347 drivers/scsi/sd.c dix = scsi_host_dix_capable(sdp->host, sdkp->protection_type); sdkp 364 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 366 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->ATO); sdkp 374 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 376 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->lbpme); sdkp 394 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 396 drivers/scsi/sd.c return sprintf(buf, "%s\n", lbp_mode[sdkp->provisioning_mode]); sdkp 403 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 404 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 410 drivers/scsi/sd.c if (sd_is_zoned(sdkp)) { sdkp 411 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_DISABLE); sdkp 422 drivers/scsi/sd.c sd_config_discard(sdkp, mode); sdkp 440 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 442 drivers/scsi/sd.c return sprintf(buf, "%s\n", zeroing_mode[sdkp->zeroing_mode]); sdkp 449 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 459 drivers/scsi/sd.c sdkp->zeroing_mode = mode; sdkp 469 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 471 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->max_medium_access_timeouts); sdkp 479 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 485 drivers/scsi/sd.c err = kstrtouint(buf, 10, &sdkp->max_medium_access_timeouts); sdkp 495 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 497 drivers/scsi/sd.c return sprintf(buf, "%u\n", sdkp->max_ws_blocks); sdkp 504 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 505 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 524 drivers/scsi/sd.c sdkp->max_ws_blocks = max; sdkp 527 drivers/scsi/sd.c sd_config_write_same(sdkp); sdkp 625 drivers/scsi/sd.c struct scsi_disk *sdkp = NULL; sdkp 630 drivers/scsi/sd.c sdkp = scsi_disk(disk); sdkp 631 drivers/scsi/sd.c if (scsi_device_get(sdkp->device) == 0) sdkp 632 drivers/scsi/sd.c get_device(&sdkp->dev); sdkp 634 drivers/scsi/sd.c sdkp = NULL; sdkp 637 drivers/scsi/sd.c return sdkp; sdkp 640 drivers/scsi/sd.c static void scsi_disk_put(struct scsi_disk *sdkp) sdkp 642 drivers/scsi/sd.c struct scsi_device *sdev = sdkp->device; sdkp 645 drivers/scsi/sd.c put_device(&sdkp->dev); sdkp 770 drivers/scsi/sd.c static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) sdkp 772 drivers/scsi/sd.c struct request_queue *q = sdkp->disk->queue; sdkp 773 drivers/scsi/sd.c unsigned int logical_block_size = sdkp->device->sector_size; sdkp 777 drivers/scsi/sd.c sdkp->unmap_alignment * logical_block_size; sdkp 779 drivers/scsi/sd.c max(sdkp->physical_block_size, sdkp 780 drivers/scsi/sd.c sdkp->unmap_granularity * logical_block_size); sdkp 781 drivers/scsi/sd.c sdkp->provisioning_mode = mode; sdkp 792 drivers/scsi/sd.c max_blocks = min_not_zero(sdkp->max_unmap_blocks, sdkp 797 drivers/scsi/sd.c if (sdkp->device->unmap_limit_for_ws) sdkp 798 drivers/scsi/sd.c max_blocks = sdkp->max_unmap_blocks; sdkp 800 drivers/scsi/sd.c max_blocks = sdkp->max_ws_blocks; sdkp 806 drivers/scsi/sd.c if (sdkp->device->unmap_limit_for_ws) sdkp 807 drivers/scsi/sd.c max_blocks = sdkp->max_unmap_blocks; sdkp 809 drivers/scsi/sd.c max_blocks = sdkp->max_ws_blocks; sdkp 815 drivers/scsi/sd.c max_blocks = min_not_zero(sdkp->max_ws_blocks, sdkp 924 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); sdkp 929 drivers/scsi/sd.c switch (sdkp->zeroing_mode) { sdkp 940 drivers/scsi/sd.c if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff) sdkp 946 drivers/scsi/sd.c static void sd_config_write_same(struct scsi_disk *sdkp) sdkp 948 drivers/scsi/sd.c struct request_queue *q = sdkp->disk->queue; sdkp 949 drivers/scsi/sd.c unsigned int logical_block_size = sdkp->device->sector_size; sdkp 951 drivers/scsi/sd.c if (sdkp->device->no_write_same) { sdkp 952 drivers/scsi/sd.c sdkp->max_ws_blocks = 0; sdkp 961 drivers/scsi/sd.c if (sdkp->max_ws_blocks > SD_MAX_WS10_BLOCKS) sdkp 962 drivers/scsi/sd.c sdkp->max_ws_blocks = min_not_zero(sdkp->max_ws_blocks, sdkp 964 drivers/scsi/sd.c else if (sdkp->ws16 || sdkp->ws10 || sdkp->device->no_report_opcodes) sdkp 965 drivers/scsi/sd.c sdkp->max_ws_blocks = min_not_zero(sdkp->max_ws_blocks, sdkp 968 drivers/scsi/sd.c sdkp->device->no_write_same = 1; sdkp 969 drivers/scsi/sd.c sdkp->max_ws_blocks = 0; sdkp 972 drivers/scsi/sd.c if (sdkp->lbprz && sdkp->lbpws) sdkp 973 drivers/scsi/sd.c sdkp->zeroing_mode = SD_ZERO_WS16_UNMAP; sdkp 974 drivers/scsi/sd.c else if (sdkp->lbprz && sdkp->lbpws10) sdkp 975 drivers/scsi/sd.c sdkp->zeroing_mode = SD_ZERO_WS10_UNMAP; sdkp 976 drivers/scsi/sd.c else if (sdkp->max_ws_blocks) sdkp 977 drivers/scsi/sd.c sdkp->zeroing_mode = SD_ZERO_WS; sdkp 979 drivers/scsi/sd.c sdkp->zeroing_mode = SD_ZERO_WRITE; sdkp 981 drivers/scsi/sd.c if (sdkp->max_ws_blocks && sdkp 982 drivers/scsi/sd.c sdkp->physical_block_size > logical_block_size) { sdkp 995 drivers/scsi/sd.c sdkp->max_ws_blocks = sdkp 996 drivers/scsi/sd.c round_down(sdkp->max_ws_blocks, sdkp 997 drivers/scsi/sd.c bytes_to_logical(sdkp->device, sdkp 998 drivers/scsi/sd.c sdkp->physical_block_size)); sdkp 1002 drivers/scsi/sd.c blk_queue_max_write_same_sectors(q, sdkp->max_ws_blocks * sdkp 1004 drivers/scsi/sd.c blk_queue_max_write_zeroes_sectors(q, sdkp->max_ws_blocks * sdkp 1019 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); sdkp 1025 drivers/scsi/sd.c if (sdkp->device->no_write_same) sdkp 1032 drivers/scsi/sd.c if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff) { sdkp 1165 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); sdkp 1199 drivers/scsi/sd.c threshold = sdkp->capacity - SD_LAST_BUGGY_SECTORS; sdkp 1213 drivers/scsi/sd.c dif = scsi_host_dif_capable(cmd->device->host, sdkp->protection_type); sdkp 1220 drivers/scsi/sd.c if (protect && sdkp->protection_type == T10_PI_TYPE2_PROTECTION) { sdkp 1336 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk_get(bdev->bd_disk); sdkp 1340 drivers/scsi/sd.c if (!sdkp) sdkp 1343 drivers/scsi/sd.c SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_open\n")); sdkp 1345 drivers/scsi/sd.c sdev = sdkp->device; sdkp 1355 drivers/scsi/sd.c if (sdev->removable || sdkp->write_prot) sdkp 1362 drivers/scsi/sd.c if (sdev->removable && !sdkp->media_present && !(mode & FMODE_NDELAY)) sdkp 1370 drivers/scsi/sd.c if (sdkp->write_prot && (mode & FMODE_WRITE)) sdkp 1383 drivers/scsi/sd.c if ((atomic_inc_return(&sdkp->openers) == 1) && sdev->removable) { sdkp 1391 drivers/scsi/sd.c scsi_disk_put(sdkp); sdkp 1410 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(disk); sdkp 1411 drivers/scsi/sd.c struct scsi_device *sdev = sdkp->device; sdkp 1413 drivers/scsi/sd.c SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_release\n")); sdkp 1415 drivers/scsi/sd.c if (atomic_dec_return(&sdkp->openers) == 0 && sdev->removable) { sdkp 1420 drivers/scsi/sd.c scsi_disk_put(sdkp); sdkp 1425 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk); sdkp 1426 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 1428 drivers/scsi/sd.c sector_t capacity = logical_to_sectors(sdp, sdkp->capacity); sdkp 1466 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(disk); sdkp 1467 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 1471 drivers/scsi/sd.c SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp, "sd_ioctl: disk=%s, " sdkp 1490 drivers/scsi/sd.c return sed_ioctl(sdkp->opal_dev, cmd, p); sdkp 1513 drivers/scsi/sd.c static void set_media_not_present(struct scsi_disk *sdkp) sdkp 1515 drivers/scsi/sd.c if (sdkp->media_present) sdkp 1516 drivers/scsi/sd.c sdkp->device->changed = 1; sdkp 1518 drivers/scsi/sd.c if (sdkp->device->removable) { sdkp 1519 drivers/scsi/sd.c sdkp->media_present = 0; sdkp 1520 drivers/scsi/sd.c sdkp->capacity = 0; sdkp 1524 drivers/scsi/sd.c static int media_not_present(struct scsi_disk *sdkp, sdkp 1536 drivers/scsi/sd.c set_media_not_present(sdkp); sdkp 1554 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk_get(disk); sdkp 1558 drivers/scsi/sd.c if (!sdkp) sdkp 1561 drivers/scsi/sd.c sdp = sdkp->device; sdkp 1562 drivers/scsi/sd.c SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_check_events\n")); sdkp 1571 drivers/scsi/sd.c set_media_not_present(sdkp); sdkp 1592 drivers/scsi/sd.c set_media_not_present(sdkp); sdkp 1596 drivers/scsi/sd.c if (media_not_present(sdkp, &sshdr)) sdkp 1604 drivers/scsi/sd.c if (!sdkp->media_present) sdkp 1606 drivers/scsi/sd.c sdkp->media_present = 1; sdkp 1616 drivers/scsi/sd.c scsi_disk_put(sdkp); sdkp 1620 drivers/scsi/sd.c static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) sdkp 1623 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 1650 drivers/scsi/sd.c sd_print_result(sdkp, "Synchronize Cache(10) failed", res); sdkp 1653 drivers/scsi/sd.c sd_print_sense_hdr(sdkp, sshdr); sdkp 1683 drivers/scsi/sd.c struct scsi_disk *sdkp = dev_get_drvdata(dev); sdkp 1685 drivers/scsi/sd.c revalidate_disk(sdkp->disk); sdkp 1698 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(disk); sdkp 1699 drivers/scsi/sd.c struct scsi_device *sdev = sdkp->device; sdkp 1713 drivers/scsi/sd.c return sed_ioctl(sdkp->opal_dev, cmd, p); sdkp 1847 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(scmd->request->rq_disk); sdkp 1850 drivers/scsi/sd.c sdkp->ignore_medium_access_errors = false; sdkp 1867 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(scmd->request->rq_disk); sdkp 1883 drivers/scsi/sd.c if (!sdkp->ignore_medium_access_errors) { sdkp 1884 drivers/scsi/sd.c sdkp->medium_access_timed_out++; sdkp 1885 drivers/scsi/sd.c sdkp->ignore_medium_access_errors = true; sdkp 1893 drivers/scsi/sd.c if (sdkp->medium_access_timed_out >= sdkp->max_medium_access_timeouts) { sdkp 1963 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(SCpnt->request->rq_disk); sdkp 1990 drivers/scsi/sd.c sd_printk(KERN_INFO, sdkp, sdkp 2005 drivers/scsi/sd.c sdkp->medium_access_timed_out = 0; sdkp 2040 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_DISABLE); sdkp 2045 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_DISABLE); sdkp 2047 drivers/scsi/sd.c sdkp->device->no_write_same = 1; sdkp 2048 drivers/scsi/sd.c sd_config_write_same(sdkp); sdkp 2060 drivers/scsi/sd.c if (sd_is_zoned(sdkp)) sdkp 2074 drivers/scsi/sd.c sd_spinup_disk(struct scsi_disk *sdkp) sdkp 2094 drivers/scsi/sd.c the_result = scsi_execute_req(sdkp->device, cmd, sdkp 2104 drivers/scsi/sd.c if (media_not_present(sdkp, &sshdr)) sdkp 2119 drivers/scsi/sd.c sd_print_result(sdkp, "Test Unit Ready failed", sdkp 2128 drivers/scsi/sd.c if (sdkp->device->no_start_on_add) sdkp 2144 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Spinning up disk..."); sdkp 2149 drivers/scsi/sd.c if (sdkp->device->start_stop_pwr_cond) sdkp 2151 drivers/scsi/sd.c scsi_execute_req(sdkp->device, cmd, DMA_NONE, sdkp 2180 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Unit Not Ready\n"); sdkp 2181 drivers/scsi/sd.c sd_print_sense_hdr(sdkp, &sshdr); sdkp 2199 drivers/scsi/sd.c static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 2201 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 2206 drivers/scsi/sd.c sdkp->protection_type = 0; sdkp 2217 drivers/scsi/sd.c if (sdkp->first_scan || type != sdkp->protection_type) sdkp 2220 drivers/scsi/sd.c sd_printk(KERN_ERR, sdkp, "formatted with unsupported" \ sdkp 2225 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2229 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2234 drivers/scsi/sd.c sdkp->protection_type = type; sdkp 2239 drivers/scsi/sd.c static void read_capacity_error(struct scsi_disk *sdkp, struct scsi_device *sdp, sdkp 2244 drivers/scsi/sd.c sd_print_sense_hdr(sdkp, sshdr); sdkp 2246 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Sense not available.\n"); sdkp 2254 drivers/scsi/sd.c set_media_not_present(sdkp); sdkp 2261 drivers/scsi/sd.c sdkp->capacity = 0; /* unknown mapped to zero - as usual */ sdkp 2271 drivers/scsi/sd.c static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, sdkp 2297 drivers/scsi/sd.c if (media_not_present(sdkp, &sshdr)) sdkp 2323 drivers/scsi/sd.c sd_print_result(sdkp, "Read Capacity(16) failed", the_result); sdkp 2324 drivers/scsi/sd.c read_capacity_error(sdkp, sdp, &sshdr, sense_valid, the_result); sdkp 2331 drivers/scsi/sd.c if (sd_read_protection_type(sdkp, buffer) < 0) { sdkp 2332 drivers/scsi/sd.c sdkp->capacity = 0; sdkp 2337 drivers/scsi/sd.c sdkp->physical_block_size = (1 << (buffer[13] & 0xf)) * sector_size; sdkp 2340 drivers/scsi/sd.c sdkp->rc_basis = (buffer[12] >> 4) & 0x3; sdkp 2345 drivers/scsi/sd.c if (alignment && sdkp->first_scan) sdkp 2346 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2350 drivers/scsi/sd.c sdkp->lbpme = 1; sdkp 2353 drivers/scsi/sd.c sdkp->lbprz = 1; sdkp 2355 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_WS16); sdkp 2358 drivers/scsi/sd.c sdkp->capacity = lba + 1; sdkp 2362 drivers/scsi/sd.c static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, sdkp 2382 drivers/scsi/sd.c if (media_not_present(sdkp, &sshdr)) sdkp 2400 drivers/scsi/sd.c sd_print_result(sdkp, "Read Capacity(10) failed", the_result); sdkp 2401 drivers/scsi/sd.c read_capacity_error(sdkp, sdp, &sshdr, sense_valid, the_result); sdkp 2412 drivers/scsi/sd.c sdkp->capacity = 0; sdkp 2413 drivers/scsi/sd.c sdkp->physical_block_size = sector_size; sdkp 2417 drivers/scsi/sd.c sdkp->capacity = lba + 1; sdkp 2418 drivers/scsi/sd.c sdkp->physical_block_size = sector_size; sdkp 2439 drivers/scsi/sd.c sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 2442 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 2445 drivers/scsi/sd.c sector_size = read_capacity_16(sdkp, sdp, buffer); sdkp 2451 drivers/scsi/sd.c sector_size = read_capacity_10(sdkp, sdp, buffer); sdkp 2455 drivers/scsi/sd.c sector_size = read_capacity_10(sdkp, sdp, buffer); sdkp 2460 drivers/scsi/sd.c if ((sizeof(sdkp->capacity) > 4) && sdkp 2461 drivers/scsi/sd.c (sdkp->capacity > 0xffffffffULL)) { sdkp 2463 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Very big device. " sdkp 2465 drivers/scsi/sd.c sector_size = read_capacity_16(sdkp, sdp, buffer); sdkp 2467 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2469 drivers/scsi/sd.c sdkp->capacity = 1 + (sector_t) 0xffffffff; sdkp 2489 drivers/scsi/sd.c (sdp->guess_capacity && (sdkp->capacity & 0x01))) { sdkp 2490 drivers/scsi/sd.c sd_printk(KERN_INFO, sdkp, "Adjusting the sector count " sdkp 2492 drivers/scsi/sd.c (unsigned long long) sdkp->capacity); sdkp 2493 drivers/scsi/sd.c --sdkp->capacity; sdkp 2499 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Sector size 0 reported, " sdkp 2507 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size %d.\n", sdkp 2515 drivers/scsi/sd.c sdkp->capacity = 0; sdkp 2526 drivers/scsi/sd.c sdkp->physical_block_size); sdkp 2527 drivers/scsi/sd.c sdkp->device->sector_size = sector_size; sdkp 2529 drivers/scsi/sd.c if (sdkp->capacity > 0xffffffff) sdkp 2538 drivers/scsi/sd.c sd_print_capacity(struct scsi_disk *sdkp, sdkp 2541 drivers/scsi/sd.c int sector_size = sdkp->device->sector_size; sdkp 2544 drivers/scsi/sd.c if (!sdkp->first_scan && old_capacity == sdkp->capacity) sdkp 2547 drivers/scsi/sd.c string_get_size(sdkp->capacity, sector_size, sdkp 2549 drivers/scsi/sd.c string_get_size(sdkp->capacity, sector_size, sdkp 2552 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2554 drivers/scsi/sd.c (unsigned long long)sdkp->capacity, sdkp 2557 drivers/scsi/sd.c if (sdkp->physical_block_size != sector_size) sdkp 2558 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2560 drivers/scsi/sd.c sdkp->physical_block_size); sdkp 2562 drivers/scsi/sd.c sd_zbc_print_zones(sdkp); sdkp 2581 drivers/scsi/sd.c sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 2584 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 2586 drivers/scsi/sd.c int old_wp = sdkp->write_prot; sdkp 2588 drivers/scsi/sd.c set_disk_ro(sdkp->disk, 0); sdkp 2590 drivers/scsi/sd.c sd_first_printk(KERN_NOTICE, sdkp, "Assuming Write Enabled\n"); sdkp 2622 drivers/scsi/sd.c sd_first_printk(KERN_WARNING, sdkp, sdkp 2625 drivers/scsi/sd.c sdkp->write_prot = ((data.device_specific & 0x80) != 0); sdkp 2626 drivers/scsi/sd.c set_disk_ro(sdkp->disk, sdkp->write_prot); sdkp 2627 drivers/scsi/sd.c if (sdkp->first_scan || old_wp != sdkp->write_prot) { sdkp 2628 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Write Protect is %s\n", sdkp 2629 drivers/scsi/sd.c sdkp->write_prot ? "on" : "off"); sdkp 2630 drivers/scsi/sd.c sd_printk(KERN_DEBUG, sdkp, "Mode Sense: %4ph\n", buffer); sdkp 2640 drivers/scsi/sd.c sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 2643 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 2650 drivers/scsi/sd.c int old_wce = sdkp->WCE; sdkp 2651 drivers/scsi/sd.c int old_rcd = sdkp->RCD; sdkp 2652 drivers/scsi/sd.c int old_dpofua = sdkp->DPOFUA; sdkp 2655 drivers/scsi/sd.c if (sdkp->cache_override) sdkp 2688 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, sdkp 2702 drivers/scsi/sd.c sd_first_printk(KERN_NOTICE, sdkp, "Truncating mode parameter " sdkp 2725 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, sdkp 2741 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, sdkp 2749 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, "No Caching mode page found\n"); sdkp 2754 drivers/scsi/sd.c sdkp->WCE = ((buffer[offset + 2] & 0x04) != 0); sdkp 2755 drivers/scsi/sd.c sdkp->RCD = ((buffer[offset + 2] & 0x01) != 0); sdkp 2757 drivers/scsi/sd.c sdkp->WCE = ((buffer[offset + 2] & 0x01) == 0); sdkp 2758 drivers/scsi/sd.c sdkp->RCD = 0; sdkp 2761 drivers/scsi/sd.c sdkp->DPOFUA = (data.device_specific & 0x10) != 0; sdkp 2763 drivers/scsi/sd.c sd_first_printk(KERN_NOTICE, sdkp, "Disabling FUA\n"); sdkp 2764 drivers/scsi/sd.c sdkp->DPOFUA = 0; sdkp 2765 drivers/scsi/sd.c } else if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw && sdkp 2766 drivers/scsi/sd.c !sdkp->device->use_16_for_rw) { sdkp 2767 drivers/scsi/sd.c sd_first_printk(KERN_NOTICE, sdkp, sdkp 2769 drivers/scsi/sd.c sdkp->DPOFUA = 0; sdkp 2773 drivers/scsi/sd.c if (sdkp->WCE && sdkp->write_prot) sdkp 2774 drivers/scsi/sd.c sdkp->WCE = 0; sdkp 2776 drivers/scsi/sd.c if (sdkp->first_scan || old_wce != sdkp->WCE || sdkp 2777 drivers/scsi/sd.c old_rcd != sdkp->RCD || old_dpofua != sdkp->DPOFUA) sdkp 2778 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, sdkp 2780 drivers/scsi/sd.c sdkp->WCE ? "enabled" : "disabled", sdkp 2781 drivers/scsi/sd.c sdkp->RCD ? "disabled" : "enabled", sdkp 2782 drivers/scsi/sd.c sdkp->DPOFUA ? "supports DPO and FUA" sdkp 2793 drivers/scsi/sd.c sd_first_printk(KERN_NOTICE, sdkp, "Cache data unavailable\n"); sdkp 2795 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, sdkp 2800 drivers/scsi/sd.c sd_first_printk(KERN_NOTICE, sdkp, sdkp 2802 drivers/scsi/sd.c sdkp->WCE = 1; sdkp 2804 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, sdkp 2806 drivers/scsi/sd.c sdkp->WCE = 0; sdkp 2808 drivers/scsi/sd.c sdkp->RCD = 0; sdkp 2809 drivers/scsi/sd.c sdkp->DPOFUA = 0; sdkp 2816 drivers/scsi/sd.c static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 2819 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 2826 drivers/scsi/sd.c if (sdkp->protection_type == 0) sdkp 2834 drivers/scsi/sd.c sd_first_printk(KERN_WARNING, sdkp, sdkp 2838 drivers/scsi/sd.c sd_print_sense_hdr(sdkp, &sshdr); sdkp 2846 drivers/scsi/sd.c sd_first_printk(KERN_ERR, sdkp, "ATO Got wrong page\n"); sdkp 2853 drivers/scsi/sd.c sdkp->ATO = 1; sdkp 2862 drivers/scsi/sd.c static void sd_read_block_limits(struct scsi_disk *sdkp) sdkp 2864 drivers/scsi/sd.c unsigned int sector_sz = sdkp->device->sector_size; sdkp 2870 drivers/scsi/sd.c scsi_get_vpd_page(sdkp->device, 0xb0, buffer, vpd_len)) sdkp 2873 drivers/scsi/sd.c blk_queue_io_min(sdkp->disk->queue, sdkp 2876 drivers/scsi/sd.c sdkp->max_xfer_blocks = get_unaligned_be32(&buffer[8]); sdkp 2877 drivers/scsi/sd.c sdkp->opt_xfer_blocks = get_unaligned_be32(&buffer[12]); sdkp 2882 drivers/scsi/sd.c sdkp->max_ws_blocks = (u32)get_unaligned_be64(&buffer[36]); sdkp 2884 drivers/scsi/sd.c if (!sdkp->lbpme) sdkp 2891 drivers/scsi/sd.c sdkp->max_unmap_blocks = lba_count; sdkp 2893 drivers/scsi/sd.c sdkp->unmap_granularity = get_unaligned_be32(&buffer[28]); sdkp 2896 drivers/scsi/sd.c sdkp->unmap_alignment = sdkp 2899 drivers/scsi/sd.c if (!sdkp->lbpvpd) { /* LBP VPD page not provided */ sdkp 2901 drivers/scsi/sd.c if (sdkp->max_unmap_blocks) sdkp 2902 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_UNMAP); sdkp 2904 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_WS16); sdkp 2907 drivers/scsi/sd.c if (sdkp->lbpu && sdkp->max_unmap_blocks) sdkp 2908 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_UNMAP); sdkp 2909 drivers/scsi/sd.c else if (sdkp->lbpws) sdkp 2910 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_WS16); sdkp 2911 drivers/scsi/sd.c else if (sdkp->lbpws10) sdkp 2912 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_WS10); sdkp 2914 drivers/scsi/sd.c sd_config_discard(sdkp, SD_LBP_DISABLE); sdkp 2926 drivers/scsi/sd.c static void sd_read_block_characteristics(struct scsi_disk *sdkp) sdkp 2928 drivers/scsi/sd.c struct request_queue *q = sdkp->disk->queue; sdkp 2937 drivers/scsi/sd.c scsi_get_vpd_page(sdkp->device, 0xb1, buffer, vpd_len)) sdkp 2947 drivers/scsi/sd.c if (sdkp->device->type == TYPE_ZBC) { sdkp 2951 drivers/scsi/sd.c sdkp->zoned = (buffer[8] >> 4) & 3; sdkp 2952 drivers/scsi/sd.c if (sdkp->zoned == 1) sdkp 2962 drivers/scsi/sd.c if (blk_queue_is_zoned(q) && sdkp->first_scan) sdkp 2963 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Host-%s zoned block device\n", sdkp 2974 drivers/scsi/sd.c static void sd_read_block_provisioning(struct scsi_disk *sdkp) sdkp 2979 drivers/scsi/sd.c if (sdkp->lbpme == 0) sdkp 2984 drivers/scsi/sd.c if (!buffer || scsi_get_vpd_page(sdkp->device, 0xb2, buffer, vpd_len)) sdkp 2987 drivers/scsi/sd.c sdkp->lbpvpd = 1; sdkp 2988 drivers/scsi/sd.c sdkp->lbpu = (buffer[5] >> 7) & 1; /* UNMAP */ sdkp 2989 drivers/scsi/sd.c sdkp->lbpws = (buffer[5] >> 6) & 1; /* WRITE SAME(16) with UNMAP */ sdkp 2990 drivers/scsi/sd.c sdkp->lbpws10 = (buffer[5] >> 5) & 1; /* WRITE SAME(10) with UNMAP */ sdkp 2996 drivers/scsi/sd.c static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 2998 drivers/scsi/sd.c struct scsi_device *sdev = sdkp->device; sdkp 3021 drivers/scsi/sd.c sdkp->ws16 = 1; sdkp 3024 drivers/scsi/sd.c sdkp->ws10 = 1; sdkp 3027 drivers/scsi/sd.c static void sd_read_security(struct scsi_disk *sdkp, unsigned char *buffer) sdkp 3029 drivers/scsi/sd.c struct scsi_device *sdev = sdkp->device; sdkp 3038 drivers/scsi/sd.c sdkp->security = 1; sdkp 3046 drivers/scsi/sd.c static bool sd_validate_opt_xfer_size(struct scsi_disk *sdkp, sdkp 3049 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 3051 drivers/scsi/sd.c logical_to_bytes(sdp, sdkp->opt_xfer_blocks); sdkp 3053 drivers/scsi/sd.c if (sdkp->opt_xfer_blocks == 0) sdkp 3056 drivers/scsi/sd.c if (sdkp->opt_xfer_blocks > dev_max) { sdkp 3057 drivers/scsi/sd.c sd_first_printk(KERN_WARNING, sdkp, sdkp 3060 drivers/scsi/sd.c sdkp->opt_xfer_blocks, dev_max); sdkp 3064 drivers/scsi/sd.c if (sdkp->opt_xfer_blocks > SD_DEF_XFER_BLOCKS) { sdkp 3065 drivers/scsi/sd.c sd_first_printk(KERN_WARNING, sdkp, sdkp 3068 drivers/scsi/sd.c sdkp->opt_xfer_blocks, SD_DEF_XFER_BLOCKS); sdkp 3073 drivers/scsi/sd.c sd_first_printk(KERN_WARNING, sdkp, sdkp 3080 drivers/scsi/sd.c if (opt_xfer_bytes & (sdkp->physical_block_size - 1)) { sdkp 3081 drivers/scsi/sd.c sd_first_printk(KERN_WARNING, sdkp, sdkp 3084 drivers/scsi/sd.c opt_xfer_bytes, sdkp->physical_block_size); sdkp 3088 drivers/scsi/sd.c sd_first_printk(KERN_INFO, sdkp, "Optimal transfer size %u bytes\n", sdkp 3100 drivers/scsi/sd.c struct scsi_disk *sdkp = scsi_disk(disk); sdkp 3101 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 3102 drivers/scsi/sd.c struct request_queue *q = sdkp->disk->queue; sdkp 3103 drivers/scsi/sd.c sector_t old_capacity = sdkp->capacity; sdkp 3107 drivers/scsi/sd.c SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, sdkp 3119 drivers/scsi/sd.c sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory " sdkp 3124 drivers/scsi/sd.c sd_spinup_disk(sdkp); sdkp 3130 drivers/scsi/sd.c if (sdkp->media_present) { sdkp 3131 drivers/scsi/sd.c sd_read_capacity(sdkp, buffer); sdkp 3143 drivers/scsi/sd.c sd_read_block_provisioning(sdkp); sdkp 3144 drivers/scsi/sd.c sd_read_block_limits(sdkp); sdkp 3145 drivers/scsi/sd.c sd_read_block_characteristics(sdkp); sdkp 3146 drivers/scsi/sd.c sd_zbc_read_zones(sdkp, buffer); sdkp 3149 drivers/scsi/sd.c sd_print_capacity(sdkp, old_capacity); sdkp 3151 drivers/scsi/sd.c sd_read_write_protect_flag(sdkp, buffer); sdkp 3152 drivers/scsi/sd.c sd_read_cache_type(sdkp, buffer); sdkp 3153 drivers/scsi/sd.c sd_read_app_tag_own(sdkp, buffer); sdkp 3154 drivers/scsi/sd.c sd_read_write_same(sdkp, buffer); sdkp 3155 drivers/scsi/sd.c sd_read_security(sdkp, buffer); sdkp 3162 drivers/scsi/sd.c sd_set_flush_flag(sdkp); sdkp 3168 drivers/scsi/sd.c dev_max = min_not_zero(dev_max, sdkp->max_xfer_blocks); sdkp 3171 drivers/scsi/sd.c if (sd_validate_opt_xfer_size(sdkp, dev_max)) { sdkp 3172 drivers/scsi/sd.c q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); sdkp 3173 drivers/scsi/sd.c rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); sdkp 3187 drivers/scsi/sd.c if (sdkp->first_scan || sdkp 3192 drivers/scsi/sd.c sdkp->first_scan = 0; sdkp 3194 drivers/scsi/sd.c set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); sdkp 3195 drivers/scsi/sd.c sd_config_write_same(sdkp); sdkp 3289 drivers/scsi/sd.c struct scsi_disk *sdkp; sdkp 3310 drivers/scsi/sd.c sdkp = kzalloc(sizeof(*sdkp), GFP_KERNEL); sdkp 3311 drivers/scsi/sd.c if (!sdkp) sdkp 3330 drivers/scsi/sd.c sdkp->device = sdp; sdkp 3331 drivers/scsi/sd.c sdkp->driver = &sd_template; sdkp 3332 drivers/scsi/sd.c sdkp->disk = gd; sdkp 3333 drivers/scsi/sd.c sdkp->index = index; sdkp 3334 drivers/scsi/sd.c atomic_set(&sdkp->openers, 0); sdkp 3335 drivers/scsi/sd.c atomic_set(&sdkp->device->ioerr_cnt, 0); sdkp 3345 drivers/scsi/sd.c device_initialize(&sdkp->dev); sdkp 3346 drivers/scsi/sd.c sdkp->dev.parent = dev; sdkp 3347 drivers/scsi/sd.c sdkp->dev.class = &sd_disk_class; sdkp 3348 drivers/scsi/sd.c dev_set_name(&sdkp->dev, "%s", dev_name(dev)); sdkp 3350 drivers/scsi/sd.c error = device_add(&sdkp->dev); sdkp 3355 drivers/scsi/sd.c dev_set_drvdata(dev, sdkp); sdkp 3361 drivers/scsi/sd.c gd->private_data = &sdkp->driver; sdkp 3362 drivers/scsi/sd.c gd->queue = sdkp->device->request_queue; sdkp 3366 drivers/scsi/sd.c sdkp->capacity = 0; sdkp 3367 drivers/scsi/sd.c sdkp->media_present = 1; sdkp 3368 drivers/scsi/sd.c sdkp->write_prot = 0; sdkp 3369 drivers/scsi/sd.c sdkp->cache_override = 0; sdkp 3370 drivers/scsi/sd.c sdkp->WCE = 0; sdkp 3371 drivers/scsi/sd.c sdkp->RCD = 0; sdkp 3372 drivers/scsi/sd.c sdkp->ATO = 0; sdkp 3373 drivers/scsi/sd.c sdkp->first_scan = 1; sdkp 3374 drivers/scsi/sd.c sdkp->max_medium_access_timeouts = SD_MAX_MEDIUM_TIMEOUTS; sdkp 3387 drivers/scsi/sd.c if (sdkp->capacity) sdkp 3388 drivers/scsi/sd.c sd_dif_config_host(sdkp); sdkp 3392 drivers/scsi/sd.c if (sdkp->security) { sdkp 3393 drivers/scsi/sd.c sdkp->opal_dev = init_opal_dev(sdp, &sd_sec_submit); sdkp 3394 drivers/scsi/sd.c if (sdkp->opal_dev) sdkp 3395 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "supports TCG Opal\n"); sdkp 3398 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", sdkp 3409 drivers/scsi/sd.c kfree(sdkp); sdkp 3428 drivers/scsi/sd.c struct scsi_disk *sdkp; sdkp 3431 drivers/scsi/sd.c sdkp = dev_get_drvdata(dev); sdkp 3432 drivers/scsi/sd.c devt = disk_devt(sdkp->disk); sdkp 3433 drivers/scsi/sd.c scsi_autopm_get_device(sdkp->device); sdkp 3436 drivers/scsi/sd.c device_del(&sdkp->dev); sdkp 3437 drivers/scsi/sd.c del_gendisk(sdkp->disk); sdkp 3440 drivers/scsi/sd.c free_opal_dev(sdkp->opal_dev); sdkp 3447 drivers/scsi/sd.c put_device(&sdkp->dev); sdkp 3464 drivers/scsi/sd.c struct scsi_disk *sdkp = to_scsi_disk(dev); sdkp 3465 drivers/scsi/sd.c struct gendisk *disk = sdkp->disk; sdkp 3468 drivers/scsi/sd.c ida_free(&sd_index_ida, sdkp->index); sdkp 3483 drivers/scsi/sd.c put_device(&sdkp->device->sdev_gendev); sdkp 3485 drivers/scsi/sd.c kfree(sdkp); sdkp 3488 drivers/scsi/sd.c static int sd_start_stop_device(struct scsi_disk *sdkp, int start) sdkp 3492 drivers/scsi/sd.c struct scsi_device *sdp = sdkp->device; sdkp 3507 drivers/scsi/sd.c sd_print_result(sdkp, "Start/Stop Unit failed", res); sdkp 3509 drivers/scsi/sd.c sd_print_sense_hdr(sdkp, &sshdr); sdkp 3530 drivers/scsi/sd.c struct scsi_disk *sdkp = dev_get_drvdata(dev); sdkp 3532 drivers/scsi/sd.c if (!sdkp) sdkp 3538 drivers/scsi/sd.c if (sdkp->WCE && sdkp->media_present) { sdkp 3539 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); sdkp 3540 drivers/scsi/sd.c sd_sync_cache(sdkp, NULL); sdkp 3543 drivers/scsi/sd.c if (system_state != SYSTEM_RESTART && sdkp->device->manage_start_stop) { sdkp 3544 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); sdkp 3545 drivers/scsi/sd.c sd_start_stop_device(sdkp, 0); sdkp 3551 drivers/scsi/sd.c struct scsi_disk *sdkp = dev_get_drvdata(dev); sdkp 3555 drivers/scsi/sd.c if (!sdkp) /* E.g.: runtime suspend following sd_remove() */ sdkp 3558 drivers/scsi/sd.c if (sdkp->WCE && sdkp->media_present) { sdkp 3559 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); sdkp 3560 drivers/scsi/sd.c ret = sd_sync_cache(sdkp, &sshdr); sdkp 3580 drivers/scsi/sd.c if (sdkp->device->manage_start_stop) { sdkp 3581 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); sdkp 3583 drivers/scsi/sd.c ret = sd_start_stop_device(sdkp, 0); sdkp 3603 drivers/scsi/sd.c struct scsi_disk *sdkp = dev_get_drvdata(dev); sdkp 3606 drivers/scsi/sd.c if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */ sdkp 3609 drivers/scsi/sd.c if (!sdkp->device->manage_start_stop) sdkp 3612 drivers/scsi/sd.c sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); sdkp 3613 drivers/scsi/sd.c ret = sd_start_stop_device(sdkp, 1); sdkp 3615 drivers/scsi/sd.c opal_unlock_from_suspend(sdkp->opal_dev); sdkp 3718 drivers/scsi/sd.c static void sd_print_sense_hdr(struct scsi_disk *sdkp, sdkp 3721 drivers/scsi/sd.c scsi_print_sense_hdr(sdkp->device, sdkp 3722 drivers/scsi/sd.c sdkp->disk ? sdkp->disk->disk_name : NULL, sshdr); sdkp 3725 drivers/scsi/sd.c static void sd_print_result(const struct scsi_disk *sdkp, const char *msg, sdkp 3732 drivers/scsi/sd.c sd_printk(KERN_INFO, sdkp, sdkp 3737 drivers/scsi/sd.c sd_printk(KERN_INFO, sdkp, sdkp 203 drivers/scsi/sd.h static inline int sd_is_zoned(struct scsi_disk *sdkp) sdkp 205 drivers/scsi/sd.h return sdkp->zoned == 1 || sdkp->device->type == TYPE_ZBC; sdkp 210 drivers/scsi/sd.h extern int sd_zbc_read_zones(struct scsi_disk *sdkp, unsigned char *buffer); sdkp 211 drivers/scsi/sd.h extern void sd_zbc_print_zones(struct scsi_disk *sdkp); sdkp 220 drivers/scsi/sd.h static inline int sd_zbc_read_zones(struct scsi_disk *sdkp, sdkp 226 drivers/scsi/sd.h static inline void sd_zbc_print_zones(struct scsi_disk *sdkp) {} sdkp 27 drivers/scsi/sd_dif.c void sd_dif_config_host(struct scsi_disk *sdkp) sdkp 29 drivers/scsi/sd_dif.c struct scsi_device *sdp = sdkp->device; sdkp 30 drivers/scsi/sd_dif.c struct gendisk *disk = sdkp->disk; sdkp 31 drivers/scsi/sd_dif.c u8 type = sdkp->protection_type; sdkp 48 drivers/scsi/sd_dif.c if (scsi_host_get_guard(sdkp->device->host) & SHOST_DIX_GUARD_IP) { sdkp 62 drivers/scsi/sd_dif.c sd_printk(KERN_NOTICE, sdkp, sdkp 68 drivers/scsi/sd_dif.c if (!sdkp->ATO) sdkp 76 drivers/scsi/sd_dif.c sd_printk(KERN_NOTICE, sdkp, "DIF application tag size %u\n", sdkp 30 drivers/scsi/sd_zbc.c static void sd_zbc_parse_report(struct scsi_disk *sdkp, u8 *buf, sdkp 33 drivers/scsi/sd_zbc.c struct scsi_device *sdp = sdkp->device; sdkp 66 drivers/scsi/sd_zbc.c static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf, sdkp 70 drivers/scsi/sd_zbc.c struct scsi_device *sdp = sdkp->device; sdkp 89 drivers/scsi/sd_zbc.c sd_printk(KERN_ERR, sdkp, sdkp 98 drivers/scsi/sd_zbc.c sd_printk(KERN_ERR, sdkp, sdkp 125 drivers/scsi/sd_zbc.c static void *sd_zbc_alloc_report_buffer(struct scsi_disk *sdkp, sdkp 128 drivers/scsi/sd_zbc.c struct request_queue *q = sdkp->disk->queue; sdkp 166 drivers/scsi/sd_zbc.c struct scsi_disk *sdkp = scsi_disk(disk); sdkp 172 drivers/scsi/sd_zbc.c if (!sd_is_zoned(sdkp)) sdkp 176 drivers/scsi/sd_zbc.c buf = sd_zbc_alloc_report_buffer(sdkp, nrz, &buflen); sdkp 180 drivers/scsi/sd_zbc.c ret = sd_zbc_do_report_zones(sdkp, buf, buflen, sdkp 181 drivers/scsi/sd_zbc.c sectors_to_logical(sdkp->device, sector), true); sdkp 188 drivers/scsi/sd_zbc.c sd_zbc_parse_report(sdkp, buf + offset, zones); sdkp 204 drivers/scsi/sd_zbc.c static inline sector_t sd_zbc_zone_sectors(struct scsi_disk *sdkp) sdkp 206 drivers/scsi/sd_zbc.c return logical_to_sectors(sdkp->device, sdkp->zone_blocks); sdkp 219 drivers/scsi/sd_zbc.c struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); sdkp 221 drivers/scsi/sd_zbc.c sector_t block = sectors_to_logical(sdkp->device, sector); sdkp 223 drivers/scsi/sd_zbc.c if (!sd_is_zoned(sdkp)) sdkp 227 drivers/scsi/sd_zbc.c if (sdkp->device->changed) sdkp 230 drivers/scsi/sd_zbc.c if (sector & (sd_zbc_zone_sectors(sdkp) - 1)) sdkp 286 drivers/scsi/sd_zbc.c static int sd_zbc_check_zoned_characteristics(struct scsi_disk *sdkp, sdkp 290 drivers/scsi/sd_zbc.c if (scsi_get_vpd_page(sdkp->device, 0xb6, buf, 64)) { sdkp 291 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 296 drivers/scsi/sd_zbc.c if (sdkp->device->type != TYPE_ZBC) { sdkp 298 drivers/scsi/sd_zbc.c sdkp->urswrz = 1; sdkp 299 drivers/scsi/sd_zbc.c sdkp->zones_optimal_open = get_unaligned_be32(&buf[8]); sdkp 300 drivers/scsi/sd_zbc.c sdkp->zones_optimal_nonseq = get_unaligned_be32(&buf[12]); sdkp 301 drivers/scsi/sd_zbc.c sdkp->zones_max_open = 0; sdkp 304 drivers/scsi/sd_zbc.c sdkp->urswrz = buf[4] & 1; sdkp 305 drivers/scsi/sd_zbc.c sdkp->zones_optimal_open = 0; sdkp 306 drivers/scsi/sd_zbc.c sdkp->zones_optimal_nonseq = 0; sdkp 307 drivers/scsi/sd_zbc.c sdkp->zones_max_open = get_unaligned_be32(&buf[16]); sdkp 315 drivers/scsi/sd_zbc.c if (!sdkp->urswrz) { sdkp 316 drivers/scsi/sd_zbc.c if (sdkp->first_scan) sdkp 317 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 338 drivers/scsi/sd_zbc.c static int sd_zbc_check_zones(struct scsi_disk *sdkp, u32 *zblocks) sdkp 353 drivers/scsi/sd_zbc.c buf = sd_zbc_alloc_report_buffer(sdkp, SD_ZBC_REPORT_MAX_ZONES, sdkp 361 drivers/scsi/sd_zbc.c ret = sd_zbc_do_report_zones(sdkp, buf, bufsize, 0, false); sdkp 365 drivers/scsi/sd_zbc.c if (sdkp->rc_basis == 0) { sdkp 368 drivers/scsi/sd_zbc.c if (sdkp->capacity != max_lba + 1) { sdkp 369 drivers/scsi/sd_zbc.c if (sdkp->first_scan) sdkp 370 drivers/scsi/sd_zbc.c sd_printk(KERN_WARNING, sdkp, sdkp 372 drivers/scsi/sd_zbc.c (unsigned long long)sdkp->capacity, sdkp 374 drivers/scsi/sd_zbc.c sdkp->capacity = max_lba + 1; sdkp 408 drivers/scsi/sd_zbc.c (block + this_zone_blocks < sdkp->capacity sdkp 417 drivers/scsi/sd_zbc.c if (block < sdkp->capacity) { sdkp 418 drivers/scsi/sd_zbc.c ret = sd_zbc_do_report_zones(sdkp, buf, bufsize, block, sdkp 424 drivers/scsi/sd_zbc.c } while (block < sdkp->capacity); sdkp 428 drivers/scsi/sd_zbc.c if (sdkp->first_scan) sdkp 429 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 434 drivers/scsi/sd_zbc.c if (sdkp->first_scan) sdkp 435 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 439 drivers/scsi/sd_zbc.c } else if (logical_to_sectors(sdkp->device, zone_blocks) > UINT_MAX) { sdkp 440 drivers/scsi/sd_zbc.c if (sdkp->first_scan) sdkp 441 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 456 drivers/scsi/sd_zbc.c int sd_zbc_read_zones(struct scsi_disk *sdkp, unsigned char *buf) sdkp 458 drivers/scsi/sd_zbc.c struct gendisk *disk = sdkp->disk; sdkp 463 drivers/scsi/sd_zbc.c if (!sd_is_zoned(sdkp)) sdkp 471 drivers/scsi/sd_zbc.c ret = sd_zbc_check_zoned_characteristics(sdkp, buf); sdkp 479 drivers/scsi/sd_zbc.c ret = sd_zbc_check_zones(sdkp, &zone_blocks); sdkp 484 drivers/scsi/sd_zbc.c blk_queue_chunk_sectors(sdkp->disk->queue, sdkp 485 drivers/scsi/sd_zbc.c logical_to_sectors(sdkp->device, zone_blocks)); sdkp 486 drivers/scsi/sd_zbc.c blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, sdkp->disk->queue); sdkp 487 drivers/scsi/sd_zbc.c blk_queue_required_elevator_features(sdkp->disk->queue, sdkp 489 drivers/scsi/sd_zbc.c nr_zones = round_up(sdkp->capacity, zone_blocks) >> ilog2(zone_blocks); sdkp 492 drivers/scsi/sd_zbc.c sdkp->device->use_16_for_rw = 1; sdkp 493 drivers/scsi/sd_zbc.c sdkp->device->use_10_for_rw = 0; sdkp 500 drivers/scsi/sd_zbc.c if (sdkp->first_scan) { sdkp 501 drivers/scsi/sd_zbc.c sdkp->zone_blocks = zone_blocks; sdkp 502 drivers/scsi/sd_zbc.c sdkp->nr_zones = nr_zones; sdkp 506 drivers/scsi/sd_zbc.c if (sdkp->zone_blocks != zone_blocks || sdkp 507 drivers/scsi/sd_zbc.c sdkp->nr_zones != nr_zones || sdkp 512 drivers/scsi/sd_zbc.c sdkp->zone_blocks = zone_blocks; sdkp 513 drivers/scsi/sd_zbc.c sdkp->nr_zones = nr_zones; sdkp 519 drivers/scsi/sd_zbc.c sdkp->capacity = 0; sdkp 524 drivers/scsi/sd_zbc.c void sd_zbc_print_zones(struct scsi_disk *sdkp) sdkp 526 drivers/scsi/sd_zbc.c if (!sd_is_zoned(sdkp) || !sdkp->capacity) sdkp 529 drivers/scsi/sd_zbc.c if (sdkp->capacity & (sdkp->zone_blocks - 1)) sdkp 530 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 532 drivers/scsi/sd_zbc.c sdkp->nr_zones - 1, sdkp 533 drivers/scsi/sd_zbc.c sdkp->zone_blocks); sdkp 535 drivers/scsi/sd_zbc.c sd_printk(KERN_NOTICE, sdkp, sdkp 537 drivers/scsi/sd_zbc.c sdkp->nr_zones, sdkp 538 drivers/scsi/sd_zbc.c sdkp->zone_blocks); sdkp 522 drivers/usb/storage/transport.c struct scsi_disk *sdkp; sdkp 552 drivers/usb/storage/transport.c sdkp = scsi_disk(disk); sdkp 553 drivers/usb/storage/transport.c if (!sdkp) sdkp 555 drivers/usb/storage/transport.c if (sector + 1 != sdkp->capacity)