Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp172636pxb; Mon, 13 Sep 2021 16:14:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBZtQIpTkBWfpF1lyIcfRfbsxilh3zMAln3oi7af0oqj2QGhl1pN6iSqc9Hy+qNUZMR0NZ X-Received: by 2002:a17:906:9aca:: with SMTP id ah10mr7971606ejc.471.1631574843928; Mon, 13 Sep 2021 16:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631574843; cv=none; d=google.com; s=arc-20160816; b=Pw31yG1SS7lYbEKWlMD28XR+kJK6+D9h55po1RRESEdWg4o8oHVAowaAUjzGxdX3yM N8ssC3Ae8Yoq2m8No3W/IJV1A16SiXCN3jaSpg8/WOOuJzXOtT7KqFyrIepZjObSOOBJ 8EDBvuSzoV4WBkCV7nIMf0a5QbTDYXJBv1v2Iszuj6hGGx9TcawMPUU1GhpNsi4Znxqg 5JKhHYI0JED/sjxhWXJTDpen3v+ok1Zx9lQvN3uozRqZ4UhB4vr6QtVbel6rC5p1JwwT OJG3garwsfrDNnxkIQCzhPofZirxhmtkeQJ0lXicv7fvoeaFCRx5EwwgUmxnL0tRhtfV jJtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HV9OoGZcB/PCrU2LcA79JB3nOel3lQwUkZ4HpsPEZS8=; b=FY4CzpAWSH0h+jZKLLrxFjZ3kxtzCmZrxRfj+eQ0s3XwOfzFVEWORRciPgrolQuJhq OnIcknGvK5tG2AjD4xwg/GEwF6q52eHi9OVheS6xZ5FeCtJcLn6QOWJajUjMtnGRWVps /fMkoh1fNnaNFQv7KgQ1ZAPxDgaqY2MT44Lo5R0X81L8/LZdfteuc5P1hph///bB+niQ i+ih31TVT7Lf+q+6zdrUAARF/nKTJ63aatpFZH/PJZQGbnknlzWLoHYSBpVgi5YWi7fb b+SaT1NySMDm66DFI/nkxj95IniShJ06vdkqsCYL2N0ls9tuEawNVOooCCDlEHiEWHYG YFuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HFwaJHSe; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si1527035ejn.761.2021.09.13.16.13.40; Mon, 13 Sep 2021 16:14:03 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=HFwaJHSe; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346994AbhIMOkK (ORCPT + 99 others); Mon, 13 Sep 2021 10:40:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:51900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347540AbhIMOem (ORCPT ); Mon, 13 Sep 2021 10:34:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B9CC61BD1; Mon, 13 Sep 2021 13:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541197; bh=kdMDeZOAHr7wVMaFI+ckBHlPCR//dK5lxel0Y49RD5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HFwaJHSe+GJRpCmOeoqaQhaZM8Ds9BwV32P4TvcYK/1b2wW22xK34Is738286/Whp BWBD2GZs2BHR0ENF9WJ8YIlbJmDz1DMQQN5vasAh4FXu5HV7HnfpSW3LA35AVVJvoa PIqHq2bSNvdUaRPhXxTGqI/MwpVHX0jdg/82uANg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Vladimir Oltean , "David S. Miller" , Sasha Levin Subject: [PATCH 5.14 170/334] net: dsa: tag_sja1105: optionally build as module when switch driver is module if PTP is enabled Date: Mon, 13 Sep 2021 15:13:44 +0200 Message-Id: <20210913131119.093497499@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean [ Upstream commit f8b17a0bd96065e4511858689916bb729dbb881b ] TX timestamps are sent by SJA1110 as Ethernet packets containing metadata, so they are received by the tagging driver but must be processed by the switch driver - the one that is stateful since it keeps the TX timestamp queue. This means that there is an sja1110_process_meta_tstamp() symbol exported by the switch driver which is called by the tagging driver. There is a shim definition for that function when the switch driver is not compiled, which does nothing, but that shim is not effective when the tagging protocol driver is built-in and the switch driver is a module, because built-in code cannot call symbols exported by modules. So add an optional dependency between the tagger and the switch driver, if PTP support is enabled in the switch driver. If PTP is not enabled, sja1110_process_meta_tstamp() will translate into the shim "do nothing with these meta frames" function. Fixes: 566b18c8b752 ("net: dsa: sja1105: implement TX timestamping for SJA1110") Reported-by: Arnd Bergmann Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/dsa/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index bca1b5d66df2..970906eb5b2c 100644 --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig @@ -138,6 +138,7 @@ config NET_DSA_TAG_LAN9303 config NET_DSA_TAG_SJA1105 tristate "Tag driver for NXP SJA1105 switches" + depends on (NET_DSA_SJA1105 && NET_DSA_SJA1105_PTP) || !NET_DSA_SJA1105 || !NET_DSA_SJA1105_PTP select PACKING help Say Y or M if you want to enable support for tagging frames with the -- 2.30.2