Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 2 Jan 2002 06:21:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 2 Jan 2002 06:21:44 -0500 Received: from lightning.swansea.linux.org.uk ([194.168.151.1]:33033 "EHLO the-village.bc.nu") by vger.kernel.org with ESMTP id ; Wed, 2 Jan 2002 06:21:33 -0500 Subject: Re: SCSI host numbers? To: nahshon@actcom.co.il Date: Wed, 2 Jan 2002 11:32:28 +0000 (GMT) Cc: linux-kernel@vger.kernel.org In-Reply-To: <200201020119.g021JoK32730@lmail.actcom.co.il> from "Itai Nahshon" at Jan 02, 2002 03:19:45 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: From: Alan Cox Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > Under some scenarios Linux assigns the same > host_no to more than one scsi device. > > Can someone tell me what is the intended behavior? A number should never be reissued. > The problem is that a newly registered device gets > its host_no from max_scsi_host. max_scsi_host is > decremented when a device driver is unregistered > (see drivers/scsi/host.c) allowing a second new > host to reuse the same host_no. I guess it needs to either only decrement the count if we are the highest one (trivial hack) or scan for a free number/keep a free bitmap. The devfs code has a handy little unique_id function for that - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/