Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp613613pxh; Tue, 9 Nov 2021 16:11:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHSGxBrNnb40bZxshkVyKO4071bJF25msZSIh/cWNGTdtMpPgRDvMUPsJ3EcV6XyQrDUVm X-Received: by 2002:a05:6602:2f15:: with SMTP id q21mr8116348iow.113.1636503097001; Tue, 09 Nov 2021 16:11:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636503096; cv=none; d=google.com; s=arc-20160816; b=ZLVjzexW4A3WCjbnvhxXXxT775U2kG1K4CFq5IIQUXg4nfmHtzXkCchls/SpJQ8zbS 81LWRfl4pdO5L58FJUYdMCfVAqVQLHJ7b0IMSal4316cEK0Wvye2a3RRTh/15lOnmZqq j4fo+Hgf74ZojOplP1xJiCuI+/28/CtChIPwA2Cvpic2/qqaFuzYlA5I5p1vFyo0T0DL 2auAOn2I8Szp4xWmnQc1MSLMF5hMdeH3LBym1Mp3e80iP2d2o+HH35uS49vahNYPe8T5 dXcOC8mHwQzwMyekyMOUVWoCj+kuhH5mpJO9zpKkxIs3/9AcnNVVdcD2J5g52CepYUZC WvdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=KZpT8QxJXvPZ/vEQ7mL1NDSD1H6v3kFSlru2WIxlImg=; b=mblnYhtVjSMgMjXZGMAUfZkGAqfvu9Kh3ZF//qibCfev49b1kpoE3P4G3/rBrrByKh cnecEAQtBX9wGP+eph9TVPS4BteIPiUa7o9LsV1/2iARRW6XpIlyYKm0NrQRrmEG9r/L ENBk5VQ1FiHgNmpd0nfs0gH9dLLLimPiVKoXIhvjvm4GHbmoVAqt2FrNqMq2n24czSGL q2kDV1qrFzicZ+DbVBXTq3ztTxe9JT/z/w6c8b2wSVzRNX+XLEzo9HP8qIKg7dUMZRWH Y7MhebWT0Ai8+cAkHoY/UPW8QgzAh/rlaLlnNVNCLpEi7D/hGYo2sApZUAq6N7+tmM72 rGGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I24IEE5s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si43656237ila.32.2021.11.09.16.11.25; Tue, 09 Nov 2021 16:11:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I24IEE5s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242077AbhKISQJ (ORCPT + 97 others); Tue, 9 Nov 2021 13:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239343AbhKISQI (ORCPT ); Tue, 9 Nov 2021 13:16:08 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 534B5C061764; Tue, 9 Nov 2021 10:13:22 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 188so6864240pgb.7; Tue, 09 Nov 2021 10:13:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KZpT8QxJXvPZ/vEQ7mL1NDSD1H6v3kFSlru2WIxlImg=; b=I24IEE5sw+29rchnsfUWJOP2lxRNVKeTIACbyXUNcPHVd/ygD1u6SozwQgdzuBmdVs ky5c/I2X2k7GMG4aGfpwm0VepagVzvlbV9JNDr5VyjtzHLvP9X2hDBymZdAP9FoJzsW1 V5icp4ubGcx1y4wUJ+/1R+i6nZ3AxIHaMbKsecxpCje3UJ0hp3yu+mPdDjM00evtTZAn MCzMU7AqHbiOQ5QuMB9o0K5MiZU2Rds3UmGXfEs6oxlpdu0k/vcn4csUX+sxzmn+WT8J 7yWgJieh6qEHuBMMmrsCnOH/YY2HeSf/osMqhjgBpOuMW+uNNQHeZ91e6PgLwYcbbLU3 XqMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KZpT8QxJXvPZ/vEQ7mL1NDSD1H6v3kFSlru2WIxlImg=; b=Gzbsg99gXiLB4Bbsl5PyAnHy82sz10IxcQz9TDDLXvBgFnw36jBRVT+KliDECPLaEO WaMVuZzrcK9yjS8YsD5XG4kYX9zyn31vwOfJK7+33kJzyf75m9u9kfMUH+8TGO+6WpmF 5sz7pe8NZeD5gyatIPiz5z7SLFqeeSgfhx4yTTc3+NAzNxtZkAFyIDJybo2kQpQ3xT2I 3ULYADevBLks808KkEBfzAPzVvLmwy6kqAL5Q2PrqSq/PUoPTKThNuQsF0DxyM7tZl/x 71H4f8ng9oqWYWZSgSpjyRom/frCbYpr9KkaeS2Z+T36rmF8qUfYtk38O+Iqd+n4DGIi afAw== X-Gm-Message-State: AOAM530wjPsuNkSKgMzJVdi/4V82vmp015XRYc0loGI2IKya67nnMsWJ ezPOhG432lFOGyZfTgQZNKnlPZ7vpL8= X-Received: by 2002:a62:dd0d:0:b0:494:6e7a:23d with SMTP id w13-20020a62dd0d000000b004946e7a023dmr10302474pff.17.1636481601344; Tue, 09 Nov 2021 10:13:21 -0800 (PST) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id pf15sm3609442pjb.40.2021.11.09.10.13.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Nov 2021 10:13:20 -0800 (PST) Subject: Re: [PATCH v2 0/7] Add PTP support for BCM53128 switch To: Martin Kaistra , Vladimir Oltean Cc: Andrew Lunn , Vivien Didelot , Richard Cochran , "David S. Miller" , Jakub Kicinski , John Stultz , Thomas Gleixner , Stephen Boyd , Russell King , Marc Kleine-Budde , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20211109095013.27829-1-martin.kaistra@linutronix.de> <20211109103936.2wjvvwhihhfqjfot@skbuf> From: Florian Fainelli Message-ID: Date: Tue, 9 Nov 2021 10:13:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/9/21 3:13 AM, Martin Kaistra wrote: > > > Am 09.11.21 um 11:39 schrieb Vladimir Oltean: >> On Tue, Nov 09, 2021 at 10:50:02AM +0100, Martin Kaistra wrote: >>> Ideally, for the B53=m case, I would have liked to include the PTP >>> support in the b53_module itself, however I couldn't find a way to do >>> that without renaming either the common source file or the module, which >>> I didn't want to do. >>> >>> Instead, b53_ptp will be allowed as a loadable module, but only if >>> b53_common is also a module, otherwise it will be built-in. >> >> Does this not work? >> >> obj-$(CONFIG_B53)        += b53_common.o >> >> ifdef CONFIG_B53_PTP >> b53_common-objs += b53_ptp.o >> endif >> >> (haven't tried though) >> > > I get: > > arm-linux-gnueabihf-ld  -EL    -r -o drivers/net/dsa/b53/b53_common.o > drivers/net/dsa/b53/b53_ptp.o > > > > and > > > > ERROR: modpost: "b53_switch_register" [drivers/net/dsa/b53/b53_mdio.ko] > undefined! > > ERROR: modpost: "b53_switch_alloc" [drivers/net/dsa/b53/b53_mdio.ko] > undefined! > > ERROR: modpost: "b53_switch_register" [drivers/net/dsa/b53/b53_spi.ko] > undefined! > > ERROR: modpost: "b53_switch_alloc" [drivers/net/dsa/b53/b53_spi.ko] > undefined! > > It seems to me, that b53_common.c does not get included at all. You need to play tricks with '-' and '_' and do something like this: obj-$(CONFIG_B53) += b53-common.o b53-common-objs += b53_common.o b53_ptp.o and that should result in a b53-common.ko which would be accepted by modprobe b53_common or b53-common AFAICT. -- Florian