Skip to content

Commit cf87100

Browse files
jacob-kellerdavem330
authored andcommitted
ice: remove unnecessary CONFIG_ICE_GNSS
CONFIG_ICE_GNSS was added by commit c7ef822 ("ice: use GNSS subsystem instead of TTY") as a way to allow the ice driver to optionally support GNSS features without forcing a dependency on CONFIG_GNSS. The original implementation of that commit at [1] used IS_REACHABLE. This was rejected by Olek at [2] with the suggested implementation of CONFIG_ICE_GNSS. Eventually after merging, Linus reported a .config which had CONFIG_ICE_GNSS = y when both GNSS = n and ICE = n. This confused him and he felt that the config option was not useful, and commented about it at [3]. CONFIG_ICE_GNSS is defined to y whenever GNSS = ICE. This results in it being set in cases where both options are not enabled. The goal of CONFIG_ICE_GNSS is to ensure that the GNSS support in the ice driver is enabled when GNSS is enabled. The complaint from Olek about the original IS_REACHABLE was due to the required IS_REACHABLE checks throughout the ice driver code and the fact that ice_gnss.c was compiled regardless of GNSS support. This can be fixed in the Makefile by using ice-$(CONFIG_GNSS) += ice_gnss.o In this case, if GNSS = m and ICE = y, we can result in some confusing behavior where GNSS support is not enabled because its not built in. See [4]. To disallow this, have CONFIG_ICE depend on GNSS || GNSS = n. This ensures that we cannot enable CONFIG_ICE as builtin while GNSS is a module. Drop CONFIG_ICE_GNSS, and replace the IS_ENABLED checks for it with checks for GNSS. Update the Makefile to add the ice_gnss.o object based on CONFIG_GNSS. This works to ensure that GNSS support can optionally be enabled, doesn't have an unnnecessary extra config option, and has Kbuild enforce the dependency such that you can't accidentally enable GNSS as a module and ICE as a builtin. [1] https://lore.kernel.org/intel-wired-lan/[email protected]/ [2] https://lore.kernel.org/intel-wired-lan/[email protected]/ [3] https://lore.kernel.org/all/CAHk-=wi_410KZqHwF-WL5U7QYxnpHHHNP-3xL=g_y89XnKc-uw@mail.gmail.com/ [4] https://lore.kernel.org/netdev/[email protected]/ Reported-by: Linus Torvalds <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Fixes: c7ef822 ("ice: use GNSS subsystem instead of TTY") Cc: Arkadiusz Kubalewski <[email protected]> Cc: Alexander Lobakin <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Anthony Nguyen <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 37e1f3a commit cf87100

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

drivers/net/ethernet/intel/Kconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ config ICE
296296
default n
297297
depends on PCI_MSI
298298
depends on PTP_1588_CLOCK_OPTIONAL
299+
depends on GNSS || GNSS = n
299300
select AUXILIARY_BUS
300301
select DIMLIB
301302
select NET_DEVLINK
@@ -337,9 +338,6 @@ config ICE_HWTS
337338
the PTP clock driver precise cross-timestamp ioctl
338339
(PTP_SYS_OFFSET_PRECISE).
339340

340-
config ICE_GNSS
341-
def_bool GNSS = y || GNSS = ICE
342-
343341
config FM10K
344342
tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
345343
default n

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
4747
ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
4848
ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
4949
ice-$(CONFIG_ICE_SWITCHDEV) += ice_eswitch.o
50-
ice-$(CONFIG_ICE_GNSS) += ice_gnss.o
50+
ice-$(CONFIG_GNSS) += ice_gnss.o

drivers/net/ethernet/intel/ice/ice_gnss.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct gnss_serial {
4545
struct list_head queue;
4646
};
4747

48-
#if IS_ENABLED(CONFIG_ICE_GNSS)
48+
#if IS_ENABLED(CONFIG_GNSS)
4949
void ice_gnss_init(struct ice_pf *pf);
5050
void ice_gnss_exit(struct ice_pf *pf);
5151
bool ice_gnss_is_gps_present(struct ice_hw *hw);
@@ -56,5 +56,5 @@ static inline bool ice_gnss_is_gps_present(struct ice_hw *hw)
5656
{
5757
return false;
5858
}
59-
#endif /* IS_ENABLED(CONFIG_ICE_GNSS) */
59+
#endif /* IS_ENABLED(CONFIG_GNSS) */
6060
#endif /* _ICE_GNSS_H_ */

0 commit comments

Comments
 (0)