From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 572C9C49EA7 for ; Fri, 25 Jun 2021 13:50:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09C5461956 for ; Fri, 25 Jun 2021 13:50:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09C5461956 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwmEI-0002cR-6z for qemu-devel@archiver.kernel.org; Fri, 25 Jun 2021 09:50:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwmDF-0001FY-Kh; Fri, 25 Jun 2021 09:49:43 -0400 Received: from mail-yb1-xb2f.google.com ([2607:f8b0:4864:20::b2f]:44603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwmD9-0005eh-VY; Fri, 25 Jun 2021 09:49:41 -0400 Received: by mail-yb1-xb2f.google.com with SMTP id p133so4700300yba.11; Fri, 25 Jun 2021 06:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=C5YSSCHGDPYX1vmL/HfrCMJzr81/PmR/Gl4/dPxCEMk=; b=jHYicn+8ynGycC897ti0O3KDL96xsYKYyz/bVlAnP6/rryrfUnuU+HyvK1mAYORGOg Fme8k8f2gig2zStAjZNVr0TVxX5oLdhydCeSEDl5cnDJanyzfiWPb4OFHAhwBhqyY+q4 ezmURyMgShRqLiMnHMqgf3yCKVCXXl2d6MVii1r4c6+mdiX/MUz2pRRp5hHv1TnFyGJY s7k2t5qdKXROcY8AjZH3Z2Jtuz5gJbMSPR0JwgmLUQUVo9V8dHb9Z1ARTI2b+YvKJMcG LYbVsxXqVB2l/boZKdy2pZHjLoknoHQDsv+tPXMsdsTdMRylkirw1OY0EBCYhFbsj7TA eyeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=C5YSSCHGDPYX1vmL/HfrCMJzr81/PmR/Gl4/dPxCEMk=; b=reqYo2mLoMfc7I3SnyqCRH02BG14fQTMCTrHIKnMEomaGHteDHKZDxnNjCIUPfpa73 6S3z5MmxIESfJSPdLfcPIBM5cn1JUrEq5vaOlM6n2J8MZLlNay//+fRwQv51UMYMV61j uCrF066MB7aNhD3xwqF4tnTif+yh4+nJI3V3LJmJpj1jkuHC+0Z90GxVunB2Xc1BM4ei XO3p6P6yQX4fBh1Z/Om04okWmakkwRl4HxDWMiXwTnNEHovWlG4uSikK4/VmQCh1VkKS 9Ypxvh4Lc8WZu+wj19CAGgcVhtbcf4t5LANMsc6UPD9vdF8loj3Ymg6z0FJGc73+34Rj 819g== X-Gm-Message-State: AOAM532TBCUzDpbxKHX9ge3zRv1niBvXOoUvoOxp6IA8HRp5XnXS8MpZ dhWvTTlI1AvOD3VQu4nR2r4ip9Lft5hrET1fB1U= X-Google-Smtp-Source: ABdhPJx137g0mnnIFpa3yQmHQFCn6ejc+Xxbxkef7pc65Horu6bMBI2jSZEKwaPpGR+nFGwN37On3QVGdDy2PIuDHZ4= X-Received: by 2002:a25:ac86:: with SMTP id x6mr12119158ybi.314.1624628974653; Fri, 25 Jun 2021 06:49:34 -0700 (PDT) MIME-Version: 1.0 References: <20210624142209.1193073-1-f4bug@amsat.org> <20210624142209.1193073-7-f4bug@amsat.org> In-Reply-To: <20210624142209.1193073-7-f4bug@amsat.org> From: Bin Meng Date: Fri, 25 Jun 2021 21:49:23 +0800 Message-ID: Subject: Re: [RFC PATCH 06/10] hw/sd: Add sd_cmd_unimplemented() handler To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::b2f; envelope-from=bmeng.cn@gmail.com; helo=mail-yb1-xb2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Qemu-block , Andrew Jeffery , Bin Meng , "qemu-devel@nongnu.org Developers" , Joel Stanley , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Thu, Jun 24, 2021 at 10:28 PM Philippe Mathieu-Daud=C3=A9 wrote: > > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/sd/sd.c | 21 ++++++++++++--------- > 1 file changed, 12 insertions(+), 9 deletions(-) > > diff --git a/hw/sd/sd.c b/hw/sd/sd.c > index 0215bdb3689..2647fd26566 100644 > --- a/hw/sd/sd.c > +++ b/hw/sd/sd.c > @@ -973,6 +973,15 @@ static sd_rsp_type_t sd_cmd_illegal(SDState *sd, SDR= equest req) > return sd_illegal; > } > > +/* Commands that are recognised but not yet implemented. */ > +static sd_rsp_type_t sd_cmd_unimplemented(SDState *sd, SDRequest req) > +{ > + qemu_log_mask(LOG_UNIMP, "%s: CMD%i not implemented\n", > + sd->proto->name, req.cmd); > + > + return sd_illegal; > +} > + > static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) > { > uint32_t rca =3D 0x0000; > @@ -1522,9 +1531,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd, > > switch (req.cmd) { > case 6: /* ACMD6: SET_BUS_WIDTH */ > - if (sd->spi) { > - goto unimplemented_spi_cmd; > - } > switch (sd->state) { > case sd_transfer_state: > sd->sd_status[0] &=3D 0x3f; > @@ -1655,12 +1661,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd, > default: > /* Fall back to standard commands. */ > return sd_normal_command(sd, req); > - > - unimplemented_spi_cmd: > - /* Commands that are recognised but not yet implemented in SPI m= ode. */ > - qemu_log_mask(LOG_UNIMP, "SD: CMD%i not implemented in SPI mode\= n", > - req.cmd); > - return sd_illegal; > } > > qemu_log_mask(LOG_GUEST_ERROR, "SD: ACMD%i in a wrong state\n", req.= cmd); > @@ -2096,6 +2096,9 @@ static const SDProto sd_proto_spi =3D { > [26] =3D sd_cmd_illegal, > [52 ... 54] =3D sd_cmd_illegal, > }, > + .cmd =3D { > + [6] =3D sd_cmd_unimplemented, > + }, > }; Does this compile? Or is this another GCC extension to C? But I think you wanted to say .acmd =3D ? Regards, Bin