Re: [PATCH V3 7/8] hw/block/nvme: support changed namespace asyncrohous event

2021-02-28 Thread Klaus Jensen
On Mar 1 01:10, Minwoo Im wrote: > If namespace inventory is changed due to some reasons (e.g., namespace > attachment/detachment), controller can send out event notifier to the > host to manage namespaces. > > This patch sends out the AEN to the host after either attach or detach > namespaces fr

[RESEND][BUG FIX HELP] QEMU main thread endlessly hangs in __ppoll()

2021-02-28 Thread Like Xu
Hi Genius, I am a user of QEMU v4.2.0 and stuck in an interesting bug, which may still exist in the mainline. Thanks in advance to heroes who can take a look and share understanding. The qemu main thread endlessly hangs in the handle of the qmp statement: {'execute': 'human-monitor-command', '

[PATCH v3 14/21] sd: emmc: Add support for emmc erase

2021-02-28 Thread Sai Pavan Boddu
Add CMD35 and CMD36 which sets the erase start and end. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 09c1222..bba0446 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1552,6 +1552,7

[PATCH v3 19/21] arm: xlnx-versal: Add emmc to versal

2021-02-28 Thread Sai Pavan Boddu
Configuring SDHCI-0 to act as eMMC controller. Signed-off-by: Sai Pavan Boddu --- include/hw/arm/xlnx-versal.h | 1 + hw/arm/xlnx-versal-virt.c| 29 + hw/arm/xlnx-versal.c | 14 -- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git

[PATCH v3 16/21] sd: emmc: Support boot area in emmc image

2021-02-28 Thread Sai Pavan Boddu
From: Joel Stanley This assumes a specially constructued image: dd if=/dev/zero of=mmc-bootarea.img count=2 bs=1M dd if=u-boot-spl.bin of=mmc-bootarea.img conv=notrunc dd if=u-boot.bin of=mmc-bootarea.img conv=notrunc count=64 bs=1K cat mmc-bootarea.img obmc-phosphor-image.wic > mmc.img

[PATCH v3 01/21] sd: sd: Remove usage of tabs in the file

2021-02-28 Thread Sai Pavan Boddu
Set tabstop as 4 and used expandtabs Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 190 ++--- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 8517dbc..74b9162 100644 --- a/hw/sd/sd.c +++ b/hw/

[PATCH v3 18/21] sd: sdhci: Support eMMC devices

2021-02-28 Thread Sai Pavan Boddu
Embedded device slots should be allowed as support of eMMC is available. Signed-off-by: Sai Pavan Boddu --- hw/sd/sdhci.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 8ffa539..771212a 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -99,10 +99,6 @@

[PATCH v3 04/21] sd: emmc: update OCR fields for eMMC

2021-02-28 Thread Sai Pavan Boddu
From: Vincent Palatin eMMC OCR register doesn't has UHS-II field and voltage fields are different. Signed-off-by: Vincent Palatin Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/s

[PATCH v3 11/21] sd: emmc: Add mmc switch function support

2021-02-28 Thread Sai Pavan Boddu
switch operation in eMMC card updates the ext_csd register to request changes in card operations. Here we implement similar sequence but requests are mostly dummy and make no change. Implement SWITCH_ERROR if the write operation extends goes beyond length of ext_csd. Signed-off-by: Sai Pavan Bodd

[PATCH v3 17/21] sd: emmc: Subtract bootarea size from blk

2021-02-28 Thread Sai Pavan Boddu
From: Joel Stanley The userdata size is derived from the file the user passes on the command line, but we must take into account the boot areas. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater --- hw/sd/sd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/sd/sd.c b/hw/

[PATCH v3 20/21] docs: devel: emmc: Add a doc for emmc card emulation

2021-02-28 Thread Sai Pavan Boddu
Add few simple steps to create emmc card with boot and user data partitions. Signed-off-by: Sai Pavan Boddu --- docs/devel/emmc.txt | 16 1 file changed, 16 insertions(+) create mode 100644 docs/devel/emmc.txt diff --git a/docs/devel/emmc.txt b/docs/devel/emmc.txt new file mod

[PATCH v3 10/21] sd: emmc: support idle state in CMD2

2021-02-28 Thread Sai Pavan Boddu
eMMC is expected to be in idle-state post CMD1. Ready state is an intermediate stage which we don't come across in Device identification mode. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/sd/sd.c | 4 1 file changed, 4 insertions(+)

[PATCH v3 00/21] eMMC support

2021-02-28 Thread Sai Pavan Boddu
Hi, This patch series add support for eMMC cards. This work was previosly submitted by Vincent, rebased few changes on top. Cedric & Joel has helped to added boot partition access support. I expect them to make a follow-up series to use it with aspeed machines. Present series adds eMMC support t

[PATCH v3 03/21] sd: emmc: Update SET_RELATIVE_ADDR command

2021-02-28 Thread Sai Pavan Boddu
From: Vincent Palatin Change SET_RELATIVE_ADDR command to assign relative address as requested by user. Signed-off-by: Vincent Palatin Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater [spb: Split original patch series] Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 12 --

[PATCH v3 15/21] sd: emmc: Update CID structure for eMMC

2021-02-28 Thread Sai Pavan Boddu
CID structure is little different for eMMC, w.r.t to product name and manufacturing date. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 47 ++- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/hw/sd/sd

[PATCH v3 12/21] sd: emmc: add CMD21 tuning sequence

2021-02-28 Thread Sai Pavan Boddu
eMMC cards support tuning sequence for entering HS200 mode. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 47 +++ 1 file changed, 47 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index bf963ec..174c28e 100644 -

[PATCH v3 05/21] sd: emmc: Add support for EXT_CSD & CSD for eMMC

2021-02-28 Thread Sai Pavan Boddu
From: Vincent Palatin eMMC CSD is similar to SD with an option to refer EXT_CSD for larger devices. Signed-off-by: Vincent Palatin [clg: Add user friendly macros for EXT_CSD register] Signed-off-by: Cédric Le Goater [spb: updated commit message] Signed-off-by: Sai Pavan Boddu --- hw/sd/sdmmc

[PATCH v3 06/21] sd: emmc: Update CMD8 to send EXT_CSD register

2021-02-28 Thread Sai Pavan Boddu
From: Vincent Palatin Sends the EXT_CSD register as response to CMD8. Signed-off-by: Vincent Palatin Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 52 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c

[PATCH v3 07/21] sd: sdmmc-internal: Add command string for SEND_OP_CMD

2021-02-28 Thread Sai Pavan Boddu
From: Cédric Le Goater This adds extra info to trace log. Signed-off-by: Sai Pavan Boddu --- hw/sd/sdmmc-internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sdmmc-internal.c b/hw/sd/sdmmc-internal.c index 2053def..8648a78 100644 --- a/hw/sd/sdmmc-internal.c +++

[PATCH v3 21/21] docs: arm: xlnx-versal-virt: Add eMMC support documentation

2021-02-28 Thread Sai Pavan Boddu
Add details of eMMC specific machine property and example for passing eMMC device. Signed-off-by: Sai Pavan Boddu --- docs/system/arm/xlnx-versal-virt.rst | 14 ++ 1 file changed, 14 insertions(+) diff --git a/docs/system/arm/xlnx-versal-virt.rst b/docs/system/arm/xlnx-versal-virt.

[PATCH v3 13/21] sd: emmc: Make ACMD41 illegal for mmc

2021-02-28 Thread Sai Pavan Boddu
ACMD41 is not applicable for eMMC. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 174c28e..09c1222 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1737,6 +1737,9 @@ static sd_rsp_ty

[PATCH v3 08/21] sd: emmc: Dont not update CARD_CAPACITY for eMMC cards

2021-02-28 Thread Sai Pavan Boddu
OCR.CARD_CAPACITY field is only valid for sd cards, So skip it for eMMC. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/sd/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 181e7e2..261

[PATCH v3 09/21] sd: emmc: Update CMD1 definition for eMMC

2021-02-28 Thread Sai Pavan Boddu
Add support to Power up the card and send response r3 in case of eMMC. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/sd/sd.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 261213

[PATCH v3 02/21] sd: emmc: Add support for eMMC cards

2021-02-28 Thread Sai Pavan Boddu
Add eMMC device built on top of SD card. Signed-off-by: Sai Pavan Boddu --- include/hw/sd/sd.h | 2 ++ hw/sd/sd.c | 20 2 files changed, 22 insertions(+) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 05ef9b7..b402dad 100644 --- a/include/hw/sd/sd.h +++

[PATCH V3 6/8] hw/block/nvme: support namespace attachment command

2021-02-28 Thread Minwoo Im
This patch supports Namespace Attachment command for the pre-defined nvme-ns device nodes. Of course, attach/detach namespace should only be supported in case 'subsys' is given. This is because if we detach a namespace from a controller, somebody needs to manage the detached, but allocated namesp

[PATCH V3 7/8] hw/block/nvme: support changed namespace asyncrohous event

2021-02-28 Thread Minwoo Im
If namespace inventory is changed due to some reasons (e.g., namespace attachment/detachment), controller can send out event notifier to the host to manage namespaces. This patch sends out the AEN to the host after either attach or detach namespaces from controllers. To support clear of the event

[PATCH V3 2/8] hw/block/nvme: fix namespaces array to 1-based

2021-02-28 Thread Minwoo Im
subsys->namespaces array used to be sized to NVME_SUBSYS_MAX_NAMESPACES. But subsys->namespaces are being accessed with 1-based namespace id which means the very first array entry will always be empty(NULL). Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/bloc

[PATCH V3 3/8] hw/block/nvme: fix allocated namespace list to 256

2021-02-28 Thread Minwoo Im
Expand allocated namespace list (subsys->namespaces) to have 256 entries which is a value lager than at least NVME_MAX_NAMESPACES which is for attached namespace list in a controller. Allocated namespace list should at least larger than attached namespace list. n->num_namespaces = NVME_MA

[PATCH V3 4/8] hw/block/nvme: support allocated namespace type

2021-02-28 Thread Minwoo Im
>From NVMe spec 1.4b "6.1.5. NSID and Namespace Relationships" defines valid namespace types: - Unallocated: Not exists in the NVMe subsystem - Allocated: Exists in the NVMe subsystem - Inactive: Not attached to the controller - Active: Attached to the controller T

[PATCH V3 1/8] hw/block/nvme: support namespace detach

2021-02-28 Thread Minwoo Im
Given that now we have nvme-subsys device supported, we can manage namespace allocated, but not attached: detached. This patch introduced a parameter for nvme-ns device named 'detached'. This parameter indicates whether the given namespace device is detached from a entire NVMe subsystem('subsys'

[PATCH V3 5/8] hw/block/nvme: refactor nvme_select_ns_iocs

2021-02-28 Thread Minwoo Im
This patch has no functional changes. This patch just refactored nvme_select_ns_iocs() to iterate the attached namespaces of the controlller and make it invoke __nvme_select_ns_iocs(). Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 36

[PATCH V3 8/8] hw/block/nvme: support Identify NS Attached Controller List

2021-02-28 Thread Minwoo Im
Support Identify command for Namespace attached controller list. This command handler will traverse the controller instances in the given subsystem to figure out whether the specified nsid is attached to the controllers or not. The 4096bytes Identify data will return with the first entry (16bits)

Re: [PATCH] hw/sd: sd: Fix build error when DEBUG_SD is on

2021-02-28 Thread Philippe Mathieu-Daudé
On 2/28/21 6:06 AM, Bin Meng wrote: > From: Bin Meng > > "qemu-common.h" should be included to provide the forward declaration > of qemu_hexdump() when DEBUG_SD is on. > > Signed-off-by: Bin Meng > --- > > hw/sd/sd.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu-Daudé

[PATCH V3 0/8] hw/block/nvme: support namespace attachment

2021-02-28 Thread Minwoo Im
Hello, This series supports namespace attachment: attach and detach. This is the third version of series with fixing command events and asynchronous events based on Keith's review. Since command effects for the namespace attachment command is added in this version, we no longer need to rescan co