Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5441651rwb; Tue, 17 Jan 2023 13:58:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXucFeEII+vj0AkEOpeqdiROSH0I20ZnU3JQYxl/52Awa34z/fQYvWUL1sp9s71SDwlnUYep X-Received: by 2002:a17:903:2593:b0:194:7400:7c26 with SMTP id jb19-20020a170903259300b0019474007c26mr5277785plb.1.1673992687300; Tue, 17 Jan 2023 13:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673992687; cv=none; d=google.com; s=arc-20160816; b=lFTpVG12i3GUDTCOnq7DYrQ89tD8c/TXJBxs++kqIX3q9029XY+imLWq0c+fpG/p7z kkto3Lu/Av6yM4kkqW0b6Nr5+PJktAq+Z1Zknog8b/zSTEnikJxVRfAgjlFXltCRhqxI i0/flYnDuR0u7G4jiLnJ3wOdOcQgeFe7PCqRbmVeb2lgMi/0msE3ePT88q83ZuaWwTgl aydzqO+RrgXqYU60nGh8HEX+SKMF3PfgmZyLTbmnQBbqugsdpqkv1CkdVQ9EvqIfomQm zdN1Tu4xwEn7uVC5ukiwiYMlNm4jg8FdnVw0/un2wXExmAxJVnW6gkwFtmaIAvybB66z wr7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hBRtIcq4Da6arpzMKkR5KTUkCNI7KY529yP53HfvvNE=; b=wFUJzynqZfci9WCmkmkFHwUbhNVElY5JKYcEz+k8ApkIuoweZ4Ys9EztL/xaiMhlMa jYZBKpHZc1tautC24L5e/+utc/EPAu4AFfOvpkqbi/MgDKIC1cdXP59NJXZC+vMhET8r ynES8MUhNzn5St6/v75PKzV7SMDbsboCUTYHkUm5u7REI2c6LBY5cNvXq7WHqrXr+Ig9 HC2c5GdcZ+xK7hHfGxaj51Tp91meiOpKIUYQLT24M02iJ1V+PbSMuzhSClc2A8xdi9PM Sg8ARXR02pnnB7p6davnv9rQNnftux6cFVPf1sG9fXQYnNiXj0pdYowEPykvm10Wnq1p g7ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=de98nGZ8; 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=broadcom.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a170902f31400b001842f55e713si29600683ple.321.2023.01.17.13.58.01; Tue, 17 Jan 2023 13:58:06 -0800 (PST) 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=@broadcom.com header.s=google header.b=de98nGZ8; 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=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbjAQVKl (ORCPT + 47 others); Tue, 17 Jan 2023 16:10:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjAQVJR (ORCPT ); Tue, 17 Jan 2023 16:09:17 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B946B9AB for ; Tue, 17 Jan 2023 11:34:16 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id x4so20227305pfj.1 for ; Tue, 17 Jan 2023 11:34:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hBRtIcq4Da6arpzMKkR5KTUkCNI7KY529yP53HfvvNE=; b=de98nGZ8szzE6F2+PlglZUwzZlkoUsqsox/Ir21aL6wqXndFnrC4BLU2eD/uUiwgvo Uo88bQn3bgw7y4clOKXvl7ZekYY1x8rsYQD0nAi3VDSq5lGUw8Hh4vgIs/JgYHqVSIZ3 /8QMrNPXpiZiViK6N53IogGTrRbQbZKntnGQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=hBRtIcq4Da6arpzMKkR5KTUkCNI7KY529yP53HfvvNE=; b=WZcypnMeQVWOcy+VwaINtor+EUmW07fX0zQpSjGKFIDOi7TMd/GylZXXdClR1FXa4v kGQD40YvIJ3Y5z5e722oIBYwYA+RqbeQWH042kMEVjdilDK1+CE6L/weZMEwGmxlBKfi f86gcc4EdXHUIbXrkfc739ZMyz6N/YRwoPSasGHAIRr32tb9PJWd5BqwCZ0Pnxr9gqHa NkkDfZ2ck5XqbH9mpErRh/aGO9bOLtE6aB1ahxEBlZb3gZNlDeyvP6gESFRbUt/lVtM1 bZbDhfdAU3JuIwBg75cY3qkIHKmsQoxFjW7vXuPSjKrnP/M8czIaiwcCGxOu398M4e3+ 4lhQ== X-Gm-Message-State: AFqh2kpSx2bJHQ7TRaNLYVTKEnzMt9VQUt6i0llNOPBcy/nLUrZr5EAS Luh0/6f1BOY18pq331Tj3h61/kaTE36o2Bo604jM1Q== X-Received: by 2002:aa7:97b8:0:b0:580:f2b8:2131 with SMTP id d24-20020aa797b8000000b00580f2b82131mr395030pfq.50.1673984055571; Tue, 17 Jan 2023 11:34:15 -0800 (PST) MIME-Version: 1.0 References: <20230112202939.19562-1-ajit.khaparde@broadcom.com> <20230112202939.19562-2-ajit.khaparde@broadcom.com> <20230113221042.5d24bdde@kernel.org> <20230116205625.394596cc@kernel.org> In-Reply-To: From: Ajit Khaparde Date: Tue, 17 Jan 2023 11:33:58 -0800 Message-ID: Subject: Re: [PATCH net-next v7 1/8] bnxt_en: Add auxiliary driver support To: Leon Romanovsky Cc: Jakub Kicinski , andrew.gospodarek@broadcom.com, davem@davemloft.net, edumazet@google.com, jgg@ziepe.ca, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, michael.chan@broadcom.com, netdev@vger.kernel.org, pabeni@redhat.com, selvin.xavier@broadcom.com Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000039d2705f27ac9ab" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE 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 --000000000000039d2705f27ac9ab Content-Type: text/plain; charset="UTF-8" On Tue, Jan 17, 2023 at 4:31 AM Leon Romanovsky wrote: > > On Mon, Jan 16, 2023 at 08:56:25PM -0800, Jakub Kicinski wrote: > > On Sat, 14 Jan 2023 12:39:09 -0800 Ajit Khaparde wrote: > > > > > +static void bnxt_aux_dev_release(struct device *dev) > > > > > +{ > > > > > + struct bnxt_aux_dev *bnxt_adev = > > > > > + container_of(dev, struct bnxt_aux_dev, aux_dev.dev); > > > > > + struct bnxt *bp = netdev_priv(bnxt_adev->edev->net); > > > > > + > > > > > + bnxt_adev->edev->en_ops = NULL; > > > > > + kfree(bnxt_adev->edev); > > > > > > > > And yet the reference counted "release" function accesses the bp->adev > > > > like it must exist. > > > > > > > > This seems odd to me - why do we need refcounting on devices at all > > > > if we can free them synchronously? To be clear - I'm not sure this is > > > > wrong, just seems odd. > > > I followed the existing implementations in that regard. Thanks > > > > Leon, could you take a look? Is there no problem in assuming bnxt_adev > > is still around in the release function? > > You caught a real bug. The auxdev idea is very simple - it needs to > behave like driver core, but in the driver itself. > > As such, bnxt_aux_dev_free() shouldn't be called after bnxt_rdma_aux_device_uninit(). > Device will be released through auxiliary_device_uninit(); > > BTW, line 325 from below shouldn't exist too. > > 312 void bnxt_rdma_aux_device_uninit(struct bnxt *bp) > 313 { > ... > 325 if (bnxt_adev->id >= 0) > 326 ida_free(&bnxt_aux_dev_ids, bnxt_adev->id); > > And one line bnxt_aux_dev_alloc() needs to be deleted too. > > Thanks Thanks. We are reviewing the comments and will have an update soon. --000000000000039d2705f27ac9ab Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQdgYJKoZIhvcNAQcCoIIQZzCCEGMCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3NMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4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