scsi_interna...vice_unblock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scsi_internal_device_unblock β€” a Kernel API Manual moment

okay so before we even start: this is from the Kernel API Manual, bestie. the kernel manual. we're in the grown-up docs today and honestly? we're thriving. πŸŽ€


🌸 NAME 🌸

scsi_internal_device_unblock β€” the "you may go back online, queen" of SCSI functions aka resume a device after a block request


✨ SYNOPSIS ✨

int scsi_internal_device_unblock (struct scsi_device *sdev , enum
       scsi_device_state new_state );

like… she takes two things and gives you back an int. short, sweet, iconic. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sdev β€” the device to resume. yes, the actual one. the little guy you put on pause earlier πŸ‘‘
  • new_state β€” the state to set the device to after unblocking. you tell her where to land, she lands there πŸ’…

πŸ’– DESCRIPTION πŸ’–

So the whole vibe here is: this restarts the device queue for a previously suspended SCSI device. that's it. that's the function. she's the "and we're back" moment. 🎬

Not me telling you this but… it may sleep. 😴 like actually. keep that in mind, okay? don't call her from a place where sleeping is illegal, iykyk.

Returns zero if successful πŸŽ‰ or a negative error code upon failure 😭. that's literally it, no surprises, we love a predictable queen.


⭐ NOTES ⭐

This routine transitions the device to the SDEV_RUNNING state, or to one of the offline states β€” and heads up, that transition must be a legal transition (no cap, it has to be legal or the whole thing falls apart πŸ™ˆ). once that's done, it lets the midlayer goose the queue for this device. "goose the queue" is genuinely the technical term and I will not be elaborating because I did not make it up πŸͺΏβœ¨


🌈 SEE ALSO 🌈

First things first, the kernel file this lives in:

./drivers/scsi/scsi_lib.c

and now, the extended friend group (there's like forty of them, buckle up 🎒):

  • __scsi_queue_insert(9)
  • scsi_queue_insert(9)
  • scsi_failures_reset_retries(9)
  • scsi_check_passthrough(9)
  • scsi_execute_cmd(9)
  • scsi_run_queue(9)
  • scsi_result_to_blk_status(9)
  • scsi_rq_err_bytes(9)
  • scsi_io_completion(9)
  • scsi_alloc_sgtables(9)
  • scsi_initialize_rq(9)
  • scsi_alloc_request(9)
  • scsi_dispatch_cmd(9)
  • scsi_get_internal_cmd(9)
  • scsi_put_internal_cmd(9)
  • scsi_device_from_queue(9)
  • scsi_block_requests(9)
  • scsi_unblock_requests(9)
  • scsi_mode_select(9)
  • scsi_mode_sense(9)
  • scsi_test_unit_ready(9)
  • scsi_device_set_state(9)
  • scsi_evt_emit(9)
  • scsi_evt_thread(9)
  • sdev_evt_send(9)
  • sdev_evt_alloc(9)
  • sdev_evt_send_simple(9)
  • scsi_device_quiesce(9)
  • scsi_device_resume(9)
  • scsi_internal_device_block_nowait(9)
  • scsi_device_block(9)
  • scsi_internal_device_unblock_nowait(9)
  • scsi_block_targets(9)
  • scsi_host_block(9)
  • scsi_kmap_atomic_sg(9)
  • scsi_kunmap_atomic_sg(9)
  • scsi_vpd_lun_id(9)
  • scsi_vpd_lun_serial(9)
  • scsi_vpd_tpg_id(9)
  • scsi_build_sense(9)

that's the whole squad. no gatekeeping here 🫢


so yeah, that's scsi_internal_device_unblock(9) β€” she unblocks, she may sleep, she returns an int, and she's legal-transition-only. slay. πŸ’…βœ¨

this lil love letter comes to you from the files at ./drivers/scsi, dated October 2026, and it's out. mwah. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from