From nobody Sat May 4 17:05:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547042717466731.7140997491141; Wed, 9 Jan 2019 06:05:17 -0800 (PST) Received: from localhost ([127.0.0.1]:48677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghETs-0003fz-1z for importer@patchew.org; Wed, 09 Jan 2019 09:05:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghES9-0002hV-VM for qemu-devel@nongnu.org; Wed, 09 Jan 2019 09:03:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghES8-0003IF-FJ for qemu-devel@nongnu.org; Wed, 09 Jan 2019 09:03:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37750) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghES8-0003I5-9f; Wed, 09 Jan 2019 09:03:28 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CE5E811DD; Wed, 9 Jan 2019 14:03:27 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E4F910A1839; Wed, 9 Jan 2019 14:03:25 +0000 (UTC) From: Thomas Huth To: David Gibson , qemu-devel@nongnu.org Date: Wed, 9 Jan 2019 15:03:23 +0100 Message-Id: <1547042603-21147-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 09 Jan 2019 14:03:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In hw/scsi/spapr_vio.c we declare that the controller supports multiple buses by specifying "max_channel =3D 7" there. So in the code that fixes up the device tree nodes, we must encode the channel number (a.k.a. bus number in the "Logical unit addressing format" table of SAM5) into the 64-bit LUN, too. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1663160 Signed-off-by: Thomas Huth --- hw/ppc/spapr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5671608..1f49489 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2905,10 +2905,11 @@ static char *spapr_get_fw_dev_path(FWPathProvider *= p, BusState *bus, if (spapr) { /* * Replace "channel@0/disk@0,0" with "disk@8000000000000000": - * We use SRP luns of the form 8000 | (bus << 8) | (id << 5) |= lun - * in the top 16 bits of the 64-bit LUN + * In the top 16 bits of the 64-bit LUN, we use SRP luns of th= e form + * 0x8000 | (target << 8) | (bus << 5) | lun + * (see the "Logical unit addressing format" table in SAM5) */ - unsigned id =3D 0x8000 | (d->id << 8) | d->lun; + unsigned id =3D 0x8000 | (d->id << 8) | (d->channel << 5) | d-= >lun; return g_strdup_printf("%s@%"PRIX64, qdev_fw_name(dev), (uint64_t)id << 48); } else if (virtio) { --=20 1.8.3.1