Issues detected related to IO_RemoveLock for IRP when Static Driver Verifier is run

I am working on migrating the USB driver(written using WDM) from Windows 7 to Windows 10/11 operating systems.
In this process, while running Static Driver Verifier tool, it detected issues around RemoveLock for IRP’s.
I am confused by the usage of RemoveLocks usage with PnPDispatch, DispatchIOCTL functions and with respect to PausedIOQueues.

Can someone provide some pointer in this regard.

When analyzed the defects, I figured that IoReleaseRemoveLock is releasing the lock irrespective of the tag provided when acquired. Is there any way to restrict of check the status of lock before releasing the lock?

Below are the list of SDV rules that are failed:
removelock
removelockcheck
removelockforward
removelockforward2
removelockforwarddevicecontrol
removelockmnremove
removelockmnremove2
removelockrelease2
removelockreleasecleanup
spinlocksafe
startdevicewait
startdevicewait3

remove locks are used to synchronize I/O (and anything else) processing with the pnp remove request. It provides simple run down semantics so that all acquires are fully released before the remove request can be processed and completed. Acquire and release calls must be paired (obviously), a missing release or release without acquire results in a state where rundown will hang (waiting for the missing release) or occur too early (the missing acquire meant the remove was processed while there was pending activity). To aid in debugging both, you can pair an acquire and release with the same tag and when you release the tag without acquiring it first, it is an error. You can choose to use the same tag everywhere (NULL) and essentially forgo this check or use a locally unique tag to aid in creating a paper trail. !remlock will provide the list of acquires with their tag and a history of tags to also help you debug.

PauseIOQueues is internal to your driver, there is no way for anyone to answer the question how remove locks are used in that context.

Thanks @Doron_Holan for your reply.

As I mentioned in my query, irrespective of the lock acquired for a specific tag, IoReleaseRemoveLock with any tag is releasing it.
May I know, the importance of tag here?

Is there any equivalent synchronizing calls?

As I already told you the tag helps you debug. IIRC in a release build, mismatched tags for acquire and release are not checked. if you have mismatched tags with verifier turned on, it will assert when you release a tag that was not acquired. https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-ioreleaseremovelock

Is there any equivalent synchronizing calls?

I have no idea what you are asking about.