All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs
@ 2019-01-09 14:03 Thomas Huth
  2019-01-11  0:27 ` David Gibson
  2019-01-13 14:54 ` no-reply
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2019-01-09 14:03 UTC (permalink / raw)
  To: David Gibson, qemu-devel; +Cc: qemu-ppc, Laurent Vivier

In hw/scsi/spapr_vio.c we declare that the controller supports multiple
buses by specifying "max_channel = 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=1663160
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 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 the form
+             * 0x8000 | (target << 8) | (bus << 5) | lun
+             * (see the "Logical unit addressing format" table in SAM5)
              */
-            unsigned id = 0x8000 | (d->id << 8) | d->lun;
+            unsigned id = 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) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs
  2019-01-09 14:03 [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs Thomas Huth
@ 2019-01-11  0:27 ` David Gibson
  2019-01-13 14:54 ` no-reply
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2019-01-11  0:27 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, qemu-ppc, Laurent Vivier

[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]

On Wed, Jan 09, 2019 at 03:03:23PM +0100, Thomas Huth wrote:
> In hw/scsi/spapr_vio.c we declare that the controller supports multiple
> buses by specifying "max_channel = 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=1663160
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Applied, thanks.

> ---
>  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 the form
> +             * 0x8000 | (target << 8) | (bus << 5) | lun
> +             * (see the "Logical unit addressing format" table in SAM5)
>               */
> -            unsigned id = 0x8000 | (d->id << 8) | d->lun;
> +            unsigned id = 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) {

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs
  2019-01-09 14:03 [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs Thomas Huth
  2019-01-11  0:27 ` David Gibson
@ 2019-01-13 14:54 ` no-reply
  1 sibling, 0 replies; 3+ messages in thread
From: no-reply @ 2019-01-13 14:54 UTC (permalink / raw)
  To: thuth; +Cc: fam, david, qemu-devel, lvivier, qemu-ppc

Patchew URL: https://patchew.org/QEMU/1547042603-21147-1-git-send-email-thuth@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-quick@centos7 SHOW_ENV=1 J=8
=== TEST SCRIPT END ===




The full log is available at
http://patchew.org/logs/1547042603-21147-1-git-send-email-thuth@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-13 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 14:03 [Qemu-devel] [PATCH] hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs Thomas Huth
2019-01-11  0:27 ` David Gibson
2019-01-13 14:54 ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.