From: Stefan Hajnoczi <stefanha@gmail.com>
To: Hannes Reinecke <hare@suse.de>
Cc: nab@linux-iscsi.org, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: [Qemu-devel] Re: [PATCH 14/15] megasas: LSI Megaraid SAS emulation
Date: Thu, 25 Nov 2010 14:52:44 +0000 [thread overview]
Message-ID: <AANLkTimqiPt6OhysmHbaLVLjGj6dDnYMRSE30ssoEcvH@mail.gmail.com> (raw)
In-Reply-To: <4CEE77CB.8050007@suse.de>
On Thu, Nov 25, 2010 at 2:50 PM, Hannes Reinecke <hare@suse.de> wrote:
> On 11/25/2010 03:36 PM, Stefan Hajnoczi wrote:
>> On Wed, Nov 24, 2010 at 11:16 AM, Hannes Reinecke <hare@suse.de> wrote:
>>> +static int megasas_pd_get_info_submit(SCSIDevice * sdev, int lun,
>>> + struct megasas_cmd_t *cmd)
>>> +{
>>> + struct mfi_pd_info * info = cmd->iov_buf;
>>> + uint8_t cmdbuf[6];
>>> + SCSIRequest *req;
>>> +
>>> + if (info->inquiry_data[4] == 0) {
>>> + /* Additional length is zero, resubmit */
>>> + megasas_setup_inquiry(cmdbuf, 0, info->inquiry_data,
>>> + sizeof(info->inquiry_data));
>>> + req = sdev->info->alloc_req(sdev, (uint32_t) -1, lun);
>>> + if (!req) {
>>> + return MFI_STAT_FLASH_ALLOC_FAIL;
>>> + }
>>> + DPRINTF_DCMD("PD get info submit std inquiry to dev %d\n", lun);
>>> + req->hba_private = cmd;
>>> + if (cmd->sdev->info->send_command(req, cmdbuf) > 0)
>>> + cmd->sdev->info->read_data(req);
>>> + return MFI_STAT_INVALID_STATUS;
>>
>> Here...
>>
>>> + } else if (info->vpd_page83[3] == 0) {
>>> + /* Additional length is zero, resubmit */
>>> + megasas_setup_inquiry(cmdbuf, 0x83,(uint8_t *)info->vpd_page83,
>>> + sizeof(info->vpd_page83));
>>> + req = sdev->info->alloc_req(sdev, (uint32_t) -1, lun);
>>> + if (!req) {
>>> + return MFI_STAT_FLASH_ALLOC_FAIL;
>>> + }
>>> + DPRINTF_DCMD("PD get info submit vpd inquiry to dev %d\n", lun);
>>> + req->hba_private = cmd;
>>> + if (cmd->sdev->info->send_command(req, cmdbuf) > 0)
>>> + cmd->sdev->info->read_data(req);
>>> + return MFI_STAT_INVALID_STATUS;
>>
>> ...and here I can't tell for sure if an error status is returned
>> intentionally or whether this is an if statement without {}-related
>> bug.
>>
>> On one hand it looks like it could be intentional. On the other hand
>> we went through the trouble of sending an inquiry command that may
>> have succeeded but we're still returning an error status.
>>
>
> MFI_STAT_INVALID_STATUS is _not_ an error status. It's used
> internally to signal that a command is still being processed.
> ->read_data() itself doesn't have a meaningful return code;
> we need to wait for the ->complete callback to get results.
> So we're returning MFI_STAT_INVALID_STATUS to signal this condition.
>
> So that's ok.
Okay, thanks for explaining.
Stefan
next prev parent reply other threads:[~2010-11-25 14:52 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-24 11:15 [Qemu-devel] [PATCH 00/15] Megasas HBA emulation and SCSI update v.3 Hannes Reinecke
2010-11-24 11:15 ` [Qemu-devel] [PATCH 01/15] scsi: Increase the number of possible devices Hannes Reinecke
2010-11-24 11:15 ` [Qemu-devel] [PATCH 02/15] scsi: Return SAM status codes Hannes Reinecke
2010-11-24 16:51 ` Christoph Hellwig
2010-11-24 11:15 ` [Qemu-devel] [PATCH 03/15] scsi: INQUIRY VPD fixes Hannes Reinecke
2010-11-24 11:15 ` [Qemu-devel] [PATCH 04/15] scsi: Move sense handling into the driver Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 05/15] scsi-disk: Remove duplicate cdb parsing Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 06/15] scsi: Update sense code handling Hannes Reinecke
2010-11-25 14:33 ` Kevin Wolf
2010-12-21 11:56 ` Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 07/15] lsi53c895a: Rename 'sense' to 'status' Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 08/15] scsi-disk: Allocate iovec dynamically Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 09/15] scsi: Use 'SCSIRequest' directly Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 10/15] scsi-disk: add data direction checking Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 11/15] Remove 'bus' argument from SCSI command completion callbacks Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 12/15] scsi: Implement 'get_sense' callback Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 13/15] scsi: Implement alloc_req_iov callback Hannes Reinecke
2010-11-24 16:52 ` Christoph Hellwig
2010-11-25 8:53 ` Hannes Reinecke
2010-11-25 15:29 ` Christoph Hellwig
2010-11-25 16:21 ` Hannes Reinecke
2010-11-26 0:06 ` Paul Brook
2010-11-24 11:16 ` [Qemu-devel] [PATCH 14/15] megasas: LSI Megaraid SAS emulation Hannes Reinecke
2010-11-25 14:36 ` [Qemu-devel] " Stefan Hajnoczi
2010-11-25 14:50 ` Hannes Reinecke
2010-11-25 14:52 ` Stefan Hajnoczi [this message]
2010-11-25 20:47 ` Sebastian Herbszt
2010-12-21 12:06 ` Hannes Reinecke
2010-11-24 11:16 ` [Qemu-devel] [PATCH 15/15] Make SCSI HBA configurable Hannes Reinecke
2010-11-24 16:50 ` [Qemu-devel] [PATCH 00/15] Megasas HBA emulation and SCSI update v.3 Christoph Hellwig
2010-12-10 22:14 ` [Qemu-devel] " Paolo Bonzini
2010-12-13 7:32 ` Hannes Reinecke
2010-12-16 1:45 ` Benjamin Herrenschmidt
2010-12-16 1:48 ` Benjamin Herrenschmidt
2010-12-16 8:34 ` Stefan Hajnoczi
2010-12-16 14:58 ` Kevin Wolf
2010-12-20 14:59 ` [Qemu-devel] " Christoph Hellwig
2010-12-20 15:25 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimqiPt6OhysmHbaLVLjGj6dDnYMRSE30ssoEcvH@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=hare@suse.de \
--cc=kraxel@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).