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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19349C77B7C for ; Thu, 4 May 2023 16:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rSvUv5yN4CeJTE+W20eGbdqhAODZINWdAIDg1/JWNM4=; b=GSJMu6pWNRJlPl /diL5SrRxHDm1kQkaw5VcJeQ8HReNaEW3QS7/zUie3pDAzQybltbKpwMRv4sNb5L8FwNyerlq0q+F 9Z5h7xLTEnoHMEtZm0pkxrABJ9k5kLfxX6kK8MJOEaE6I9kNQzrEvoUL9mHQ4cxQMF5plDWFo1GTY ucW4jD7aQbSBC0R/O571BE6svLB/3GdpY1wr8XLjp1FoqYvJ3ZkIu3gBfN/ue/OaHH6tp0Eko4pjO Nw9Z2crfxYObfaH247T7mmjpAbm13Z2OVyiXV/4vYX20YSK/tWz3iR6GrZ14n6HVLVxK8Vsiz/dHj ZEMkojc2SsICRIaa1rMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pubui-008LS8-2C; Thu, 04 May 2023 16:34:40 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pubuf-008LRZ-2l for linux-arm-kernel@lists.infradead.org; Thu, 04 May 2023 16:34:39 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-94f3cd32799so141530466b.0 for ; Thu, 04 May 2023 09:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683218075; x=1685810075; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nszTvAg6fphYuzaPSYnd3w5WMHZrZJJaEUI5zTnvsx4=; b=dhxD37R48wLSmMqoo+yOvb619nXn47MDnAlUoME6jFo/UJ4C+dA44spBJdEsQXo/BB ZJATJlWpYr1F5QCJ6s4RbliW9MHK/oFSkY0nYFR4f0yiNMmYfywayOEQedzYAybRAfgf l926ylMz4mrzTXBojvCkJGyiiK4Nt/Z5vnxxDPKwxpzhN8BnWyhI/3Z3fqL0sARvjGL3 nEqAjz6mwz7o5kO33wL8e4wrte01H86lLz7FmFbBcYDnJfOE+HEmf+MVoK+XrfQByDpC YLwdqYNtyB4F+0X8T4psmNmW2EkRXtWJoHu47vmhJk6a1mzVnGPmJcViYA00Qi45MKpn NCJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683218075; x=1685810075; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nszTvAg6fphYuzaPSYnd3w5WMHZrZJJaEUI5zTnvsx4=; b=N80q3hl3XNQsrPs9/1++4fbcI3UU1gM/WqgdfZDxi9GZgEKFMMi5cAomgqM2mNeeEV k8tmJ5l8TaPLxJhm4hL1pRBNZePiYpyM3dx1/F0fge7oKrcImMN7c6jE8VPEVnuulyEB oDs8cJD1PsYCXt2sYNV0ojf5/Af86TUA4kdWXsu0alYPQkLTFQpdIWmRaKMLxNZS0s5c va6tAoh0ZKjwmx1eVJtWEtnEYQf1sKZxMyWlEO6AfiaG+1QLtQl8+HfVZU5LCrOX7RjK Hilq1StM+KDikVzJ35Kw7u3kjaHx52TmtSgniOwLm7k52tTn5GwLC1H/x4qUmiaWHPkw d6eQ== X-Gm-Message-State: AC+VfDzVl9yDPdickO/wmTYd5gSw/gZ9SAGyLuOhq4NAtorwLP3Qmpkg ZNn7GEqqxoZpoUkAFmWicEVBbg== X-Google-Smtp-Source: ACHHUZ7UTw09BUZkzS6zw6s3B83bTJ2iIzEWu8O3/gcd5QbYIqL3Pcttt0DLEfeqNgf6m6beVNV0ow== X-Received: by 2002:a17:907:a412:b0:961:be96:b0e0 with SMTP id sg18-20020a170907a41200b00961be96b0e0mr6847612ejc.73.1683218075231; Thu, 04 May 2023 09:34:35 -0700 (PDT) Received: from ?IPV6:2a02:810d:15c0:828:bdb9:99c4:33a5:6114? ([2a02:810d:15c0:828:bdb9:99c4:33a5:6114]) by smtp.gmail.com with ESMTPSA id n20-20020a1709065db400b00965b439027csm802967ejv.195.2023.05.04.09.34.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 May 2023 09:34:34 -0700 (PDT) Message-ID: <500e5abc-fb71-8468-a6b0-3ced2676b57c@linaro.org> Date: Thu, 4 May 2023 18:34:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v3 04/18] soc: qcom: Add Qualcomm minidump kernel driver Content-Language: en-US From: Krzysztof Kozlowski To: Mukesh Ojha , agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, corbet@lwn.net, keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, catalin.marinas@arm.com, will@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org, srinivas.kandagatla@linaro.org Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org References: <1683133352-10046-1-git-send-email-quic_mojha@quicinc.com> <1683133352-10046-5-git-send-email-quic_mojha@quicinc.com> <23b493f4-1a01-8d03-fc12-d588b2c6fd74@quicinc.com> <575a422d-6224-06b7-628c-8487b47882e9@linaro.org> In-Reply-To: <575a422d-6224-06b7-628c-8487b47882e9@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230504_093437_915163_3E1C932D X-CRM114-Status: GOOD ( 11.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 04/05/2023 17:21, Krzysztof Kozlowski wrote: >>> >>>> + ret = qcom_minidump_init_apss_subsystem(md); >>>> + if (ret) { >>>> + dev_err(&pdev->dev, "apss minidump initialization failed: %d\n", ret); >>>> + goto unlock; >>>> + } >>>> + >>>> + __md = md; >>> >>> No. This is a platform device, so it can have multiple instances. >> >> It can have only one instance that is created from SMEM driver probe. > > Anyone can instantiate more of them.... how did you solve it? To clarify - sprinkling more of singletons makes everything tightly coupled, difficult to debug and non-portable. You cannot have two instances, you have to control concurrent initialization by yourself in each of such singletons. I understand sometimes they are unavoidable, for example when this does not map to hardware property. However here you have the parent - smem - which can return you valid instance. Thus you avoid entire problem of file-scope variables. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel