LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-16-2011, 08:26 AM   #1
neo3matrix
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Rep: Reputation: 0
How to reset/decrease scsi host number


Hi,

In /proc/scsi/scsi, we can see the scsi host no. (scsi identifier no.).
for e.g.
Host: scsi4 Channel: 00 Id: 01 Lun: 00

In above e.g., scsi identifier no. is 4.

Whenever we modprobe a particular module associated with scsi devices, we can see new entry in /proc/scsi/scsi with a greater identifier no.
When we do rmmod on that module, the entry from /proc/scsi/scsi wipes off but still the counter of scsi identifier no. doesn't decreases.


So, my question is is there any way to reset or decrement this counter so that next time when I do modprobe on scsi related module, it will assign no.s starting with 0 ???

Thanks in advance.....
 
Old 02-17-2011, 09:06 AM   #2
neo3matrix
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Hi,
I found more information after some googling.

I found that during registering a scsi device, scsi_register() method gets value from "next_host" (which is a static int initialized to 0) and then increments next_host counter.
Also, during scsi_unregister(), it decrements next_host counter.

rmmod internally calls scsi_unregister().

So, if it is true then why the scsi host id. doesn't decrement during rmmod?
Can anybody give me some guidelines?
 
Old 02-18-2011, 02:24 PM   #3
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
I do NOT see that scsi_unregister() decrease next_host counter and do see that scsi_register() increase next_host counter.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Transfer large number of files host to host blainemiller Linux - Newbie 5 10-20-2010 04:52 PM
error for aacraid: Host adapter reset request. SCSI hang ? pankajd Linux - Newbie 1 01-03-2010 02:49 AM
Need scsi command to get serial number of a scsi tape romeshs Programming 1 09-04-2006 06:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration