* [PATCH] hw/ufs: avoid generating the same ID string for different LU devices
@ 2023-12-04 15:05 Akinobu Mita
2023-12-04 16:50 ` [PATCH-for-8.2?] " Philippe Mathieu-Daudé
[not found] ` <CGME20231204165101epcas2p3ed3c9102682beb57ceed403189b33ef5@epcms2p8>
0 siblings, 2 replies; 5+ messages in thread
From: Akinobu Mita @ 2023-12-04 15:05 UTC (permalink / raw)
To: qemu-devel; +Cc: akinobu.mita, jeuk20.kim
QEMU would not start when trying to create two UFS host controllers and
a UFS logical unit for each with the following options:
-device ufs,id=bus0 \
-device ufs-lu,drive=drive1,bus=bus0,lun=0 \
-device ufs,id=bus1 \
-device ufs-lu,drive=drive2,bus=bus1,lun=0 \
This is because the same ID string ("0:0:0/scsi-disk") is generated
for both UFS logical units.
To fix this issue, prepend the parent pci device's path to make
the ID string unique.
("0000:00:03.0/0:0:0/scsi-disk" and "0000:00:04.0/0:0:0/scsi-disk")
Fixes: 096434fea13a ("hw/ufs: Modify lu.c to share codes with SCSI subsystem")
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
hw/ufs/ufs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
index 68c5f1f6c9..eccdb852a0 100644
--- a/hw/ufs/ufs.c
+++ b/hw/ufs/ufs.c
@@ -1323,9 +1323,17 @@ static bool ufs_bus_check_address(BusState *qbus, DeviceState *qdev,
return true;
}
+static char *ufs_bus_get_dev_path(DeviceState *dev)
+{
+ BusState *bus = qdev_get_parent_bus(dev);
+
+ return qdev_get_dev_path(bus->parent);
+}
+
static void ufs_bus_class_init(ObjectClass *class, void *data)
{
BusClass *bc = BUS_CLASS(class);
+ bc->get_dev_path = ufs_bus_get_dev_path;
bc->check_address = ufs_bus_check_address;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.2?] hw/ufs: avoid generating the same ID string for different LU devices
2023-12-04 15:05 [PATCH] hw/ufs: avoid generating the same ID string for different LU devices Akinobu Mita
@ 2023-12-04 16:50 ` Philippe Mathieu-Daudé
2023-12-04 19:21 ` Philippe Mathieu-Daudé
[not found] ` <CGME20231204192120epcas2p3e10bef4174d3ff1e7a6caaa55ed5a7ab@epcms2p8>
[not found] ` <CGME20231204165101epcas2p3ed3c9102682beb57ceed403189b33ef5@epcms2p8>
1 sibling, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-12-04 16:50 UTC (permalink / raw)
To: Akinobu Mita, qemu-devel; +Cc: jeuk20.kim, qemu-block
On 4/12/23 16:05, Akinobu Mita wrote:
> QEMU would not start when trying to create two UFS host controllers and
> a UFS logical unit for each with the following options:
>
> -device ufs,id=bus0 \
> -device ufs-lu,drive=drive1,bus=bus0,lun=0 \
> -device ufs,id=bus1 \
> -device ufs-lu,drive=drive2,bus=bus1,lun=0 \
>
> This is because the same ID string ("0:0:0/scsi-disk") is generated
> for both UFS logical units.
>
> To fix this issue, prepend the parent pci device's path to make
> the ID string unique.
> ("0000:00:03.0/0:0:0/scsi-disk" and "0000:00:04.0/0:0:0/scsi-disk")
>
> Fixes: 096434fea13a ("hw/ufs: Modify lu.c to share codes with SCSI subsystem")
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/ufs/ufs.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
> index 68c5f1f6c9..eccdb852a0 100644
> --- a/hw/ufs/ufs.c
> +++ b/hw/ufs/ufs.c
> @@ -1323,9 +1323,17 @@ static bool ufs_bus_check_address(BusState *qbus, DeviceState *qdev,
> return true;
> }
>
> +static char *ufs_bus_get_dev_path(DeviceState *dev)
> +{
> + BusState *bus = qdev_get_parent_bus(dev);
> +
> + return qdev_get_dev_path(bus->parent);
> +}
> +
> static void ufs_bus_class_init(ObjectClass *class, void *data)
> {
> BusClass *bc = BUS_CLASS(class);
> + bc->get_dev_path = ufs_bus_get_dev_path;
> bc->check_address = ufs_bus_check_address;
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.2?] hw/ufs: avoid generating the same ID string for different LU devices
2023-12-04 16:50 ` [PATCH-for-8.2?] " Philippe Mathieu-Daudé
@ 2023-12-04 19:21 ` Philippe Mathieu-Daudé
[not found] ` <CGME20231204192120epcas2p3e10bef4174d3ff1e7a6caaa55ed5a7ab@epcms2p8>
1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-12-04 19:21 UTC (permalink / raw)
To: Akinobu Mita, qemu-devel; +Cc: jeuk20.kim, qemu-block
Hi Jeuk,
On 4/12/23 17:50, Philippe Mathieu-Daudé wrote:
> On 4/12/23 16:05, Akinobu Mita wrote:
>> QEMU would not start when trying to create two UFS host controllers and
>> a UFS logical unit for each with the following options:
>>
>> -device ufs,id=bus0 \
>> -device ufs-lu,drive=drive1,bus=bus0,lun=0 \
>> -device ufs,id=bus1 \
>> -device ufs-lu,drive=drive2,bus=bus1,lun=0 \
>>
>> This is because the same ID string ("0:0:0/scsi-disk") is generated
>> for both UFS logical units.
>>
>> To fix this issue, prepend the parent pci device's path to make
>> the ID string unique.
>> ("0000:00:03.0/0:0:0/scsi-disk" and "0000:00:04.0/0:0:0/scsi-disk")
>>
>> Fixes: 096434fea13a ("hw/ufs: Modify lu.c to share codes with SCSI
>> subsystem")
If you think this must be fixed for the 8.2 release, please assign
a release blocker issues to the GitLab 8.2 milestone here:
https://gitlab.com/qemu-project/qemu/-/milestones/10
>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>> ---
>> hw/ufs/ufs.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
>> index 68c5f1f6c9..eccdb852a0 100644
>> --- a/hw/ufs/ufs.c
>> +++ b/hw/ufs/ufs.c
>> @@ -1323,9 +1323,17 @@ static bool ufs_bus_check_address(BusState
>> *qbus, DeviceState *qdev,
>> return true;
>> }
>> +static char *ufs_bus_get_dev_path(DeviceState *dev)
>> +{
>> + BusState *bus = qdev_get_parent_bus(dev);
>> +
>> + return qdev_get_dev_path(bus->parent);
>> +}
>> +
>> static void ufs_bus_class_init(ObjectClass *class, void *data)
>> {
>> BusClass *bc = BUS_CLASS(class);
>> + bc->get_dev_path = ufs_bus_get_dev_path;
>> bc->check_address = ufs_bus_check_address;
>> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CGME20231204192120epcas2p3e10bef4174d3ff1e7a6caaa55ed5a7ab@epcms2p8>]
* Re: [PATCH-for-8.2?] hw/ufs: avoid generating the same ID string for different LU devices
[not found] ` <CGME20231204192120epcas2p3e10bef4174d3ff1e7a6caaa55ed5a7ab@epcms2p8>
@ 2023-12-05 5:18 ` Jeuk Kim
0 siblings, 0 replies; 5+ messages in thread
From: Jeuk Kim @ 2023-12-05 5:18 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel@nongnu.org
Cc: Akinobu Mita, qemu-block
Hi Philippe,
Thank you for informing me.
I want this issue is fixed for the 8.2 release.
I created an issue like you said, but I couldn't assign the milestone (I'm guessing it's a permission problem).
https://gitlab.com/qemu-project/qemu/-/issues/2018
Could you help me with this?
Regardless, I'm going to submit a pull request to fix the issue right away.
Thank you.
On 4/12/23, Philippe Mathieu-Daudé wrote:
> Hi Jeuk,
>
> On 4/12/23 17:50, Philippe Mathieu-Daudé wrote:
>> On 4/12/23 16:05, Akinobu Mita wrote:
>>> QEMU would not start when trying to create two UFS host controllers and
>>> a UFS logical unit for each with the following options:
>>>
>>> -device ufs,id=bus0 \
>>> -device ufs-lu,drive=drive1,bus=bus0,lun=0 \
>>> -device ufs,id=bus1 \
>>> -device ufs-lu,drive=drive2,bus=bus1,lun=0 \
>>>
>>> This is because the same ID string ("0:0:0/scsi-disk") is generated
>>> for both UFS logical units.
>>>
>>> To fix this issue, prepend the parent pci device's path to make
>>> the ID string unique.
>>> ("0000:00:03.0/0:0:0/scsi-disk" and "0000:00:04.0/0:0:0/scsi-disk")
>>>
>>> Fixes: 096434fea13a ("hw/ufs: Modify lu.c to share codes with SCSI
>>> subsystem")
>
> If you think this must be fixed for the 8.2 release, please assign
> a release blocker issues to the GitLab 8.2 milestone here:
> https://gitlab.com/qemu-project/qemu/-/milestones/10
>
>>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>>> ---
>>> hw/ufs/ufs.c 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>>
>>> diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
>>> index 68c5f1f6c9..eccdb852a0 100644
>>> --- a/hw/ufs/ufs.c
>>> +++ b/hw/ufs/ufs.c
>>> @@ -1323,9 +1323,17 @@ static bool ufs_bus_check_address(BusState
>>> *qbus, DeviceState *qdev,
>>> return true;
>>> }
>>> +static char *ufs_bus_get_dev_path(DeviceState *dev)
>>> +{
>>> + BusState *bus = qdev_get_parent_bus(dev);
>>> +
>>> + return qdev_get_dev_path(bus->parent);
>>> +}
>>> +
>>> static void ufs_bus_class_init(ObjectClass *class, void *data)
>>> {
>>> BusClass *bc = BUS_CLASS(class);
>>> + bc->get_dev_path = ufs_bus_get_dev_path;
>>> bc->check_address = ufs_bus_check_address;
>>> }
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CGME20231204165101epcas2p3ed3c9102682beb57ceed403189b33ef5@epcms2p8>]
* Re: [PATCH-for-8.2?] hw/ufs: avoid generating the same ID string for different LU devices
[not found] ` <CGME20231204165101epcas2p3ed3c9102682beb57ceed403189b33ef5@epcms2p8>
@ 2023-12-05 4:33 ` Jeuk Kim
0 siblings, 0 replies; 5+ messages in thread
From: Jeuk Kim @ 2023-12-05 4:33 UTC (permalink / raw)
To: Akinobu Mita, qemu-devel@nongnu.org
Cc: Philippe Mathieu-Daudé, qemu-block
On 4/12/23 16:05, Akinobu Mita wrote:
> QEMU would not start when trying to create two UFS host controllers and
> a UFS logical unit for each with the following options:
>
> -device ufs,id=bus0 \
> -device ufs-lu,drive=drive1,bus=bus0,lun=0 \
> -device ufs,id=bus1 \
> -device ufs-lu,drive=drive2,bus=bus1,lun=0 \
>
> This is because the same ID string ("0:0:0/scsi-disk") is generated
> for both UFS logical units.
>
> To fix this issue, prepend the parent pci device's path to make
> the ID string unique.
> ("0000:00:03.0/0:0:0/scsi-disk" and "0000:00:04.0/0:0:0/scsi-disk")
>
> Fixes: 096434fea13a ("hw/ufs: Modify lu.c to share codes with SCSI subsystem")
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Thank you!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-12-05 5:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 15:05 [PATCH] hw/ufs: avoid generating the same ID string for different LU devices Akinobu Mita
2023-12-04 16:50 ` [PATCH-for-8.2?] " Philippe Mathieu-Daudé
2023-12-04 19:21 ` Philippe Mathieu-Daudé
[not found] ` <CGME20231204192120epcas2p3e10bef4174d3ff1e7a6caaa55ed5a7ab@epcms2p8>
2023-12-05 5:18 ` Jeuk Kim
[not found] ` <CGME20231204165101epcas2p3ed3c9102682beb57ceed403189b33ef5@epcms2p8>
2023-12-05 4:33 ` Jeuk Kim
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).