Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5217347img; Wed, 27 Mar 2019 04:32:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1haLYyTA3uXvlJK8tzTCCZSORhPPch9EHGgfAKw74UmXOwN71NfltHNZ8mdqMsNffltED X-Received: by 2002:a62:12c9:: with SMTP id 70mr30948882pfs.156.1553686353204; Wed, 27 Mar 2019 04:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553686353; cv=none; d=google.com; s=arc-20160816; b=sC6Caz96UvuGmfabzbn9pM4QM0AvDrUGqpZ6kn3DdJ1GjbR0F0ZBFbotj7EdMxxYZl lteFV58h16y1Wzm2/tDCXT7UaJjTW+7hfmQ+nIJllmwyyXcnc2ygTwba0SKK1Sh2ccqs 30xlEV69DIo2FZfBIlwsyKVgIyA+b89qR6xoy5EUy83Sug8JmfXOv1mf88E/h34AdL41 RyzvH2dPAY1lKNA25NDvDxTtpDUWEBJyMco0ve1THEhcSMU0Ed3nuR0mDboI8qD64eEd DJKtvdo0bBCL5iWQT8ock6RT2n3HvxFzhUPg0ro3gYMKeRD0AHEOWnYIh4Jxo2zQeioN hXmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=AmHhFBkV1ySh7Yi5Wsjv7o0clogTO2z/TTy14NEDxEs=; b=D8IJ6GTaMwAU0lmbxpogSgK0rrmhOj4VoyMPD9OrR8ruk6AfUANRO9OmwDuPnT0tNJ ekBJGE1SHRkUYCzJ6dF8gp0IjCc/5oxgHfbZ0ReQblkRvBDUH8lRn5Fvyy9nU4Z+ktdp 1uHILOH9rLI009xQpTweTBq3UZn7UNy2wK/XkhtEO0VXEyokEzGLWJqtDL2UZEKrclvY Q+CPZkj8UkY6MuY1q/LVARi8WOlHVNWzKDBevIVhG8Cw8Oy3C1FQevDFuyMnHaI9Augq inpMzvrCa29GtCxHtA0oZpq7vChBsfhqliKq6YF3vG6F4kll+8L2mQ+by/qeUKj0rYRF 9MxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3si7423331pgr.189.2019.03.27.04.32.16; Wed, 27 Mar 2019 04:32:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbfC0Lbk (ORCPT + 99 others); Wed, 27 Mar 2019 07:31:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:47244 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbfC0Lbk (ORCPT ); Wed, 27 Mar 2019 07:31:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 367FCAEE3; Wed, 27 Mar 2019 11:31:38 +0000 (UTC) Subject: Re: megasas: Unexpected response from lun 1 while scanning, scan aborted To: Dongli Zhang , qemu-block@nongnu.org, linux-scsi@vger.kernel.org, megaraidlinux.pdl@broadcom.com Cc: linux-kernel@vger.kernel.org, qemu-devel@nongnu.org References: <9c3849cf-86c6-4568-bff5-1050b445322d@default> From: Hannes Reinecke Message-ID: Date: Wed, 27 Mar 2019 12:31:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <9c3849cf-86c6-4568-bff5-1050b445322d@default> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/26/19 5:47 PM, Dongli Zhang wrote: > I am reporting an error that the scsi lun cannot initialize successfully when I > am emulating megasas scsi controller with qemu. > > I am not sure if this is issue in qemu or linux kernel. > > When 'lun=1' is specified, there is "Unexpected response from lun 1 while > scanning, scan aborted". > > Everything works well if 'lun=0' is specified. > > > Below is the qemu cmdline involved: > > -device megasas,id=scsi0 \ > -device scsi-hd,drive=drive0,bus=scsi0.0,lun=1 \ > -drive file=/home/zhang/img/test.img,if=none,id=drive0,format=raw > > > Below is the syslog related to 'scsi|SCSI' > > # dmesg | grep SCSI > [ 0.392494] SCSI subsystem initialized > [ 0.460666] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251) > [ 0.706788] sd 1:0:0:0: [sda] Attached SCSI disk > # dmesg | grep scsi > [ 0.511643] scsi host0: Avago SAS based MegaRAID driver > [ 0.523302] scsi 0:2:0:0: Unexpected response from lun 1 while scanning, scan aborted > [ 0.540364] scsi host1: ata_piix > [ 0.540780] scsi host2: ata_piix > [ 0.702396] scsi 1:0:0:0: Direct-Access ATA QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5 > > When 'lun=1' is changed to 'lun=0', there is no issue. > > Thank you very much! > That's an artifact from the megasas emulation in quemu. Megasas (internally) can't handle LUN numbers (the RAID part only knows about 'disks'), so I took the decision to not expose devices with LUN != 0. Please use a different SCSI target number, not a non-zero LUN number. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)