Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp37659pxy; Thu, 29 Apr 2021 23:14:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCUxPiVxfRmt7v5kYeLyRWQJbrH+8OzrX6uQcUmP1de/necUqu2t+6+rgA+UugjCXeL4Dw X-Received: by 2002:a63:2686:: with SMTP id m128mr3287090pgm.406.1619763293823; Thu, 29 Apr 2021 23:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619763293; cv=none; d=google.com; s=arc-20160816; b=MHtMPxd+JxLHPk2Z4Nu+YoqWDmd38BhV1RsoMSJ2QtHd13OVKVS3cDsXY4LAlf9x2l C7rLDHb8XdbhBiIkSc1ub6lSegXSkXHKMyT2ScX1a7oksrfo6F7EiAe1PpfaJIiGFfBo wpDNrswP41dMkJWAtwYTHB/UtzEMsFvhZufdQnhld3IrLFtdjT13dBpM/N2gJF5sr5ka q+8kXwdGXW7gm0Ri6Cm9PHRRh8WYa53VA1cqUD5aPpTMb9MR1mtLCdKvXyue7RxHR4PY w/9Bl8gvDtWNKKpCtRT3s/DlOI01uBXRNIoOuCNLyH/FsdUY+sGq5rYf5yCQiBkdQU+d hLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DxynFfDpuwJtJkg8gx5czayPX9kb0rIzF28ZKYs4mnw=; b=Qr93KmMleCI0g/BeUjdS7QjX4qEflJjiduk9A5wZD36NTFSS6TU42zJlN0JejXevL2 AOCwMsgJ4Cko0lTpghBn2iy4PclYmpWwtxGCYL6//lY+egTzJQV2W26GpOW9kKVGmeHw nj7wHJwf9BNcvZtyTu6Ri7DwE0iTzknNwYmKX45odwB+jFdibsGaOpsEsU1e2wKQkAsx WWUTEPmKc3OQVHPOYY9yCGCvsv34csRzCDChqlGiy98OdzGctTWfPzYFOe9iqunBi5Mr NcNzJ1ZD+udbvUlTM6Vtc1BPNzmhX9wngq4p2+ULfkwaNLJskFrpBMFregc2omQ52z1T TfMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t129si2401505pgc.565.2021.04.29.23.14.07; Thu, 29 Apr 2021 23:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbhD3GL5 (ORCPT + 99 others); Fri, 30 Apr 2021 02:11:57 -0400 Received: from gw.atmark-techno.com ([13.115.124.170]:37524 "EHLO gw.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbhD3GL4 (ORCPT ); Fri, 30 Apr 2021 02:11:56 -0400 Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by gw.atmark-techno.com (Postfix) with ESMTPS id 84CAB801BA for ; Fri, 30 Apr 2021 15:11:06 +0900 (JST) Received: by mail-pj1-f69.google.com with SMTP id oc5-20020a17090b1c05b029014c095a5149so34232506pjb.2 for ; Thu, 29 Apr 2021 23:11:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DxynFfDpuwJtJkg8gx5czayPX9kb0rIzF28ZKYs4mnw=; b=pB7FpbKNlALMiHZffOge+sZNNfZepoWQXoGNS4+lnIsIHXeV8/WN/3qvz7YhVLKtSR jXd2jT9DUuM0cLX7R0KqkUcQdPJu9uugu9i+D3ZdrtvweOeBAvbP0aWlkj2+CjxyvCuT nG7Fv1S9tIuKKF/siw3J6VAYXc5YS+KAp8SanlJP/0YaWz3aun/M0jsWrrWpmWKhkp+Z UZdr3+sO4uzE40NlGGdxIO9C8QJP4HQzfoq0Tpzv3yYCTtZs46qQmBe50XZe8VtL8YqI zSnwIpSZP1ddpCwDlK6QNJgJca3uBq1qDxJReAiiOIH8kG5OHlc0FZ/qRg6PPeJybaev OmmQ== X-Gm-Message-State: AOAM532euuseph8Z/xqbyxk2oMd6r3XJIBC0g/PkIs1CLx+mfZXQcThU ppHdZz7n4KFV8hqwLWHKvdpvPvQJAGbRX7ORNGdy68Nq9jLaQF+5MJk7IC/by5kput/K1IID6Es CIoiUU/7So0lYHAD9MHsmaV3sI/0S X-Received: by 2002:aa7:8010:0:b029:254:f083:66fa with SMTP id j16-20020aa780100000b0290254f08366famr3417636pfi.17.1619763064949; Thu, 29 Apr 2021 23:11:04 -0700 (PDT) X-Received: by 2002:aa7:8010:0:b029:254:f083:66fa with SMTP id j16-20020aa780100000b0290254f08366famr3417613pfi.17.1619763064669; Thu, 29 Apr 2021 23:11:04 -0700 (PDT) Received: from pc-0115 (70.211.187.35.bc.googleusercontent.com. [35.187.211.70]) by smtp.gmail.com with ESMTPSA id 14sm930318pfl.1.2021.04.29.23.11.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Apr 2021 23:11:04 -0700 (PDT) Received: from martinet by pc-0115 with local (Exim 4.94) (envelope-from ) id 1lcMMg-005CAI-AS; Fri, 30 Apr 2021 15:11:02 +0900 Date: Fri, 30 Apr 2021 15:10:52 +0900 From: Dominique Martinet To: "Alice Guo (OSS)" Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, horia.geanta@nxp.com, aymen.sghaier@nxp.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v1 1/2] caam: imx8m: fix the built-in caam driver cannot match soc_id Message-ID: References: <20210429140250.2321-1-alice.guo@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210429140250.2321-1-alice.guo@oss.nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Alice Guo (OSS) wrote on Thu, Apr 29, 2021 at 10:02:49PM +0800: > From: Alice Guo > > drivers/soc/imx/soc-imx8m.c is probed later than the caam driver so that > return -EPROBE_DEFER is needed after calling soc_device_match() in > drivers/crypto/caam/ctrl.c. For i.MX8M, soc_device_match returning NULL > can be considered that the SoC device has not been probed yet, so it > returns -EPROBE_DEFER directly. So basically you're saying if the soc is imx8m then soc_device_match() has to find a match -- if for some reason there is rightfully no match the caam driver will forever loop on EPROBE_DEFER (not sure how that is handled by the driver stack?); but in this particular case we don't actually need soc_device_match() to work: it's just there to pick the appropriate clock data from caam_imx_soc_table[], and we already know we should use &caam_imx7_data if imx8m_machine_match got a hit. If we're going this way (making the caam driver only handle soc init being late as that was noticeable), then I'd tend to agree with arnd's comment[1] and not rely on soc_device_match at all in this case -- just keeping it as a fallback if direct of_match_node didn't work for compabitility with other devices. [1] https://lore.kernel.org/r/CAK8P3a1GjeHyMCworQYVtp5U0uu2B9VBHmf9y0hGn-o8aKSJZw@mail.gmail.com/ Note I haven't had time to play with device_link_add or other ways to make the soc init successfully early, but it's probably better to not wait for me on this so I'm quite happy with this for now. > Fixes: 7d981405d0fd ("soc: imx8m: change to use platform driver") > Signed-off-by: Alice Guo And philosophical questions aside, this works for me: Tested-by: Dominique Martinet -- Dominique