Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26699189rwd; Mon, 3 Jul 2023 13:36:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/oW3nqYnmYFUJmGZzEYkY3/ZyBEOzuyjv8TY39lAfW6Oki1GokuM5Oa0joJXqlH1guOuY X-Received: by 2002:a05:6a21:9985:b0:125:4d74:cd6a with SMTP id ve5-20020a056a21998500b001254d74cd6amr22067841pzb.3.1688416600389; Mon, 03 Jul 2023 13:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688416600; cv=none; d=google.com; s=arc-20160816; b=f5V6LQ5JPIUxs2WmEl6DoM1ZHTwi6NdgGlBvA1TqoTJSl7Wa5cxs8yG/fkF1cax98l 8lkq2use5QW37VDrppQZl31+IHSeipRhDVzQn+j+Yn8SwkDerRc7e3hKE79hPIRFgglr 3sqpT+Sao18e3vrz3v3IWiw7Pgzx9rsZI/z08w1RyE0Gbz1hWEPJNQtVNdBXK+5SYrM2 YhzGe1vGrRUXi3D78njIkb/ZmXsePF9/+W6sjajQ8jEMkJrsVEjQb6I7jtz9MCgEZc0X 0jNlh5pZ9xQrYNZleJ8VM10mRwLHp4wLwaO8UmjFAs2U69YvTBqsda7IjtF86AeXQ6Fy GLdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=btFntjY0O3IvQAR+9HWAi9QrudxEpvSJmgYuJTKvtTI=; fh=V03Ti5qwpjUTv2CNQor1WDKrAkhA+LTyTYfFAfU1nRc=; b=hH6KfnJ7eMHhl36RgtBLWZ/ZG/pXuWuyd3sTdqFV8OoYUH/drYWECp8kMpEkeww2D9 q38cDMtBaFr8tY+aqI/pbr9TSG/kiyvDcMcqpZz38rQnEJu5D7FGVQ++1wEf2txhN+G8 ZIn1Cs3kuE7I0rgqrXn6kQLgAAzaXqHs7YB/RSbccuOJ0JSuYiMJr8Kri9pJj2tg/3wO VscXr2JZ6EqlRiZvA4uizYkBkd6l6uxKi19hyWQMPmxPYMUxgVNe4wsmApMHxX7YEF8n bQe8bgueZ/q2v9JnaA4BHRP/jiFuZFCkaQB9oTYfHp9gRGSWK1mPQb6s1XGiziSye0k7 JqWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b="P/2IY1xg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q188-20020a632ac5000000b0053f6910ccc8si18907473pgq.747.2023.07.03.13.36.27; Mon, 03 Jul 2023 13:36:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b="P/2IY1xg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbjGCU24 (ORCPT + 99 others); Mon, 3 Jul 2023 16:28:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbjGCU2z (ORCPT ); Mon, 3 Jul 2023 16:28:55 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10AC4AF; Mon, 3 Jul 2023 13:28:54 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51d9695ec29so4578206a12.1; Mon, 03 Jul 2023 13:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1688416132; x=1691008132; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=btFntjY0O3IvQAR+9HWAi9QrudxEpvSJmgYuJTKvtTI=; b=P/2IY1xgAl3/k1IG0imh55eAHTfrSdB5GD9jlHerOgWmBqtOW+2iTqhMRvaBCZn8bM epXKrQtZswPggaRgmebsXPy72F+87TqNgiEOv7/hjwRsf+5xGlkxaj1Cavn29gHcSiir 8gVjUY3iaDSvWlBwXKP6/N2mfnwyjsdylTfL3N4WXOoeJhBTyksduxZdYRDVPEenxK41 e7SjW1T+8QA091QNxC3ef3O50hzyAnpO6vn0k2/vxl6IIj/Bt3c9RwPCRhvNAxlURxIC CCX37YvD0MP45pfZ65cUCKYZk+mbQiIYMD+R3ij+Bb3zWnHRGCS2HtFxiWVyqej8iNbq TAMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688416132; x=1691008132; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=btFntjY0O3IvQAR+9HWAi9QrudxEpvSJmgYuJTKvtTI=; b=h7nyxsQncaiTALpy875/tYSGKMTaJqo8HNqS0VP85EhpS9DQ2xcludw9+3n4z3Ecc/ eb1YQjcq4oz0qzA9oHg9YyJVJdNJ53x1+UbNjcvWE48VI1ViWy6Ltb2GMc8Ykl2pJzPx E9hpw4m9cSrxuWl2plA+AcvGr+xT6vfFOfcRKgTj4SWH7jg7ElaRmOMQipLRN4ks59+R CV1knf/gIBUhIYh9J3cLHML+kcgd7T9vi5gUVN++OZf4aQO+6Jo+bMINNe0dVQ0y7ry2 Xrj+fi4ADrk2udsdePEVL5FAhxHXijE4KMCgH8g3QPOJX4Z028MQKG9rqBdPMeBzWbb8 Yd7Q== X-Gm-Message-State: ABy/qLYbqxGix9yULsrJNDcKzWnWl5JfbQJBDf9qNzoTlrK5uMogWP3u YxusgPknzTvY0JaviIBw1EKntmOcPIIXlh8g+pg= X-Received: by 2002:a17:907:76ab:b0:992:d013:1132 with SMTP id jw11-20020a17090776ab00b00992d0131132mr6440806ejc.1.1688416132254; Mon, 03 Jul 2023 13:28:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Martin Blumenstingl Date: Mon, 3 Jul 2023 22:28:41 +0200 Message-ID: Subject: Re: [PATCH] mmc: meson-mx-sdhc: Fix initialization frozen issue To: Ziyang Huang Cc: ulf.hansson@linaro.org, neil.armstrong@linaro.org, khilman@baylibre.com, jbrunet@baylibre.com, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Jun 19, 2023 at 9:51=E2=80=AFPM Martin Blumenstingl wrote: > > Hello, > > first of all: thank you for this patch! > > On Mon, Jun 19, 2023 at 7:36=E2=80=AFPM Ziyang Huang = wrote: > > > > Commit 4bc31edebde5 ("mmc: core: Set HS clock speed before sending > > HS CMD13") set HS clock (52MHz) before switching to HS mode. For this > > freq, FCLK_DIV5 will be selected and div value is 10 (reg value is 9). > > Then we set rx_clk_phase to 11 or 15 which is out of range and make > > hardware frozen. After we send command request, no irq will be > > interrupted and the mmc driver will keep to wait for request finished, > > even durning rebooting. > I think this is the exact same problem I reported some days ago: [0] > Ulf is questioning whether we properly support 52MHz clocks correctly, > so I think you're onto something! > > So this is an excellent finding! I can confirm that using rx_clk_phase > of 1 makes my Odroid-C1 eMMC work again :-) > > > So let's set a common value - 1 just for initialization. Then let > > meson_mx_sdhc_execute_tuning() to find the accurate value for data > > transfer. > As far as I know unconditionally using value 1 can negatively affect > other devices. > I'm assuming that you're testing on an Odroid-C1 or similar board with > HS200 eMMC: > On those SoC + eMMC combinations we do support. But on other boards > (for example Meson8b EC-100 / Endless Mini) there's no HS200 support > because the eMMC is connected with 3.3V IO lines. So tuning is not > executed there (if I recall correctly). > > What do you think about adding a special case for the 51MHz "actual > clock rate" and adding a comment that it was found by manual testing? > For some reason (that I don't understand) Amlogic's vendor driver > maxes out at 47.22MHz (presumably because they limit themselves to > using FCLK_DIV3 as input only - but I don't get why...). Did you have the chance to look into my comment? I would like to hear your opinion on this topic! Best regards, Martin