From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by mx.groups.io with SMTP id smtpd.web12.14165.1588620924289395822 for ; Mon, 04 May 2020 12:35:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ISJ6gTHi; spf=pass (domain: oracle.com, ip: 156.151.31.85, mailfrom: nikita.leshchenko@oracle.com) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 044JXkIu126689; Mon, 4 May 2020 19:35:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2020-01-29; bh=8TjIAoCp99gCROcFramm1hOXLSR6uLvlApv0Se8b2PM=; b=ISJ6gTHiCZr5jdudTh2VZrvsFPurH8wL9K+RyxHLg8OmI2tXp4KqcBayQtdn2aGSpDo1 am4nKn9npWT7bF7jSsrDjmTEdS1jsYQRzzRwZ06C3TZIhYPwBgyO7v5g//S+u8+h2tJb QIo1f4pohk3BnduUSy+BXK96M+bzu3+NxO/3Bzp7T2PEfuB+CZrsM5VCjejR0m25clJx TiJzV1at4khLJUi6Gar3hScTqi+fEl8W5djVEh7w2g5eqaxjXvzfFolIYJnFPpm8dwiT ZAPn0Q6L6eCxOjbak2Ygh3vLHAzONqBQ6Wtd76AS6BDLtUv7BOwNOwTs01hXawgW5s1t dg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 30s1gn0s3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 May 2020 19:35:21 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 044JWUqB070129; Mon, 4 May 2020 19:35:21 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 30sjjwm435-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 May 2020 19:35:20 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 044JZJkk000632; Mon, 4 May 2020 19:35:19 GMT Received: from [10.30.3.6] (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 May 2020 12:35:19 -0700 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [edk2-devel] [PATCH v5 10/12] OvmfPkg/MptScsiDxe: Initialize hardware From: "Nikita Leshenko" In-Reply-To: <803cf42d-2c43-5c49-55ff-31b3acdba776@redhat.com> Date: Mon, 4 May 2020 22:35:15 +0300 Cc: devel@edk2.groups.io, liran.alon@oracle.com, aaron.young@oracle.com, Jordan Justen , Ard Biesheuvel Message-Id: <8C267BCF-8124-4E50-995A-EA0E0B79E44F@oracle.com> References: <20200424175927.41210-1-nikita.leshchenko@oracle.com> <20200424175927.41210-11-nikita.leshchenko@oracle.com> <803cf42d-2c43-5c49-55ff-31b3acdba776@redhat.com> To: Laszlo Ersek X-Mailer: Apple Mail (2.3445.9.1) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9611 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9611 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 phishscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040153 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > On 29 Apr 2020, at 17:55, Laszlo Ersek wrote: >=20 > On 04/24/20 19:59, Nikita Leshenko wrote: >> [...] >> +STATIC >> +EFI_STATUS >> +MptScsiInit ( >> + IN MPT_SCSI_DEV *Dev >> + ) >> +{ >> + EFI_STATUS Status; >> + MPT_IO_CONTROLLER_INIT_REQUEST Req; >=20 > [...] >=20 > You can either introduce a new typedef for the alignment / union under > IndustryStandard, or just define an ad-hoc union here in this = function, > like PvScsiDxe does. Yes you're right, I missed that, sorry. >=20 > [...] > "Please use another STATIC_ASSERT here for expressing that the = response > structure size is an integer multiple of sizeof (UINT16)." Missed that too, sorry >=20 >> [...] >> // >> // Ext SCSI Pass Thru >> // >> @@ -382,6 +557,11 @@ MptScsiControllerStart ( >> )); >> } >>=20 >> + Status =3D MptScsiInit (Dev); >> + if (EFI_ERROR (Status)) { >> + goto RestoreAttributes; >=20 > Hmmm, git-range-diff flags this as a v4->v5 change, and I don't > understand why... >=20 > Ah, OK. In v4, we jumped to "RestorePciAttributes" -- which was a > non-existent label. So I think the v4 variant of this patch didn't > compile. I hope that's fixed now, with the above. :) Yes, I ran `git rebase --exec` to make sure that all patches compiled = and I noticed that. Nikita >=20 > The rest of the updates / patch look fine to me. >=20 > Thanks! > Laszlo >=20 >=20 >> + } >> + >> // >> // Host adapter channel, doesn't exist >> // >> @@ -406,11 +586,14 @@ MptScsiControllerStart ( >> &Dev->PassThru >> ); >> if (EFI_ERROR (Status)) { >> - goto RestoreAttributes; >> + goto UninitDev; >> } >>=20 >> return EFI_SUCCESS; >>=20 >> +UninitDev: >> + MptScsiReset (Dev); >> + >> RestoreAttributes: >> Dev->PciIo->Attributes ( >> Dev->PciIo, >> @@ -470,6 +653,8 @@ MptScsiControllerStop ( >> return Status; >> } >>=20 >> + MptScsiReset (Dev); >> + >> Dev->PciIo->Attributes ( >> Dev->PciIo, >> EfiPciIoAttributeOperationSet, >>=20 >=20