Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1029228ybb; Wed, 8 Apr 2020 15:01:24 -0700 (PDT) X-Google-Smtp-Source: APiQypJ/sbwsMuOErLxFISl5J+sxZOfyhl+C57Ilxa7Bfa3fdnmstkd4kzDdzXHXsIWcZHVzSbwU X-Received: by 2002:a9d:6052:: with SMTP id v18mr2194356otj.227.1586383284623; Wed, 08 Apr 2020 15:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586383284; cv=none; d=google.com; s=arc-20160816; b=ivYHiThkJBzXCS9jSvppwmNJ0Z+ZjO/2vM62dIrtn4ZMvc4ucjZ04tALk2scFHgV87 vUWo/9jk/dpeW+IBRPx7AbkucCdtia8mGKkUXEZkN2JDyJWGsyivAz/i/Q6cbbYTJZHh ubAPw84hiI144OI83HbvOiAOMJX8Il6QUiYdeFsQbB8/PKzFqDoVMZFIw36VTkBbQdjI a5BsX4HpFKdlwlveCJYA4RdOtpvafXXAP3DNUm0lmbo7KJXxZf8ihpogOYqZuoRZ1CtS fp05a63Cd8Tm3z0ZrtdS5E30vDf//G0HvD18WZeHXZI3lXR+Wgn8MNjAC+LAzhUajsMI aiww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=fN4JOUYXzZadhHaigIxCdjHL5JQOp1zv8p0cKNRSlto=; b=FrbzghzhGSgCtlJcLhHwUmaf7pxa5/zGI5ACyP9cKpwjAv0nX88bPdaMYTcA/ugyJx SGIlnsrk/xSYLHG2QFi8k7ASIFzxAm6mJO+xpZk+QC3BYH77hhWhN6sL5oqkQ/V6y4Ux oMhb7vkyZ5ZDPQTZ/m4qj+N4zzIOLGBdFmuIhXRm0sU6Uo7yC83ppoaqYfIysC4Ht2Eh POS8KdvRvWaYZevBeSiBMZSys5u1jnHRjT3FTl9dfxF7o9EszeIXfryO+8aQovUg872V g1VwSh/pErubx+m5nWuVyaKEKzdWfvYlgrX2v2SrOcFz3BIpEyrPuepoZ/GsuyVGeaT2 sB9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hlOthodM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f12si3207313otc.147.2020.04.08.15.01.11; Wed, 08 Apr 2020 15:01:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hlOthodM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729567AbgDHVha (ORCPT + 99 others); Wed, 8 Apr 2020 17:37:30 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35741 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbgDHVha (ORCPT ); Wed, 8 Apr 2020 17:37:30 -0400 Received: by mail-wm1-f65.google.com with SMTP id r26so1609862wmh.0; Wed, 08 Apr 2020 14:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fN4JOUYXzZadhHaigIxCdjHL5JQOp1zv8p0cKNRSlto=; b=hlOthodMjO6sjcfcFgccaZ5PMj6V6vILjdJSDPQJgVhPz9GHOlo05D53ScrTPPvFMh wC1oWvzgN1o7eyi0KBFyOY0UERDgw/ODH6MdC1ghsZb8jlScHD/HmAU6Udh1iViY5/3C 0SbEuhzT5fM3teMC5iNGNv58Khvtt4DEGbfSUGcTZ28w7K0j0M0ZTDfP3HhcSTZ8obY4 2z1hfIjSVsV9dE+L6qIbbo/b/XrTS9ttbRrbsTpUXsck6BQgQo3ELJ+kNqQ9yP7B8WNr b3Un1zfGwO280S3y8HGc5iBOju5CLaoUU9O/wsxnA37UdaLGlxafOtOwuFZpLrrAh/fO ZWWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fN4JOUYXzZadhHaigIxCdjHL5JQOp1zv8p0cKNRSlto=; b=asUmbuSX2T9DiHL8J6yWbfCrEcNDmwsFC+6ImtbUPYpu7PKGf77v3Ce0rH86UuGD2W IafJw+sPfkufwAPQJ0CG+spdjQ4cW+ttvbRjeDX0WY+nxHb487lzKYnFEwVf8MfO/CuL tr6DlvXDEBTczTrZf23IFuNIY7ev6hdHlEn7t7FqGiFK2azUoXS6ajO5eZ7inS+4bLhv wfVzIafRuy4db9Mejc9yuD9vciq2YGsmte2mQyUOD7bfX2YYJyG0S4gU0sS1Va2DMV+c 53zTq0wF3PdQlfZgTaGMBq4tzCEsEYMdH3weYqMSNvTB3C35UQcdDgLFZWh82+Aap6ln t7PQ== X-Gm-Message-State: AGi0PuY0zcRuhcGjDdEVOdoq34SkX0133m7WFjYY58dgyeJ4ozIsXI5T mVT92+vFr9KLMxSipxVbwb/Jwp91 X-Received: by 2002:a1c:2056:: with SMTP id g83mr6533900wmg.179.1586381847878; Wed, 08 Apr 2020 14:37:27 -0700 (PDT) Received: from ?IPv6:2003:ea:8f29:6000:695e:ad67:528c:ed17? (p200300EA8F296000695EAD67528CED17.dip0.t-ipconnect.de. [2003:ea:8f29:6000:695e:ad67:528c:ed17]) by smtp.googlemail.com with ESMTPSA id p10sm36707335wrm.6.2020.04.08.14.37.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Apr 2020 14:37:27 -0700 (PDT) Subject: Re: RFC: Handle hard module dependencies that are not symbol-based (r8169 + realtek) From: Heiner Kallweit To: Lucas De Marchi , Jessica Yu Cc: Linux Kernel Mailing List , linux-modules@vger.kernel.org, "netdev@vger.kernel.org" References: Message-ID: <88aabe57-b38f-2200-05ab-7f54bda274fe@gmail.com> Date: Wed, 8 Apr 2020 23:37:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.04.2020 23:20, Heiner Kallweit wrote: > Currently we have no way to express a hard dependency that is not > a symbol-based dependency (symbol defined in module A is used in > module B). Use case: > Network driver ND uses callbacks in the dedicated PHY driver DP > for the integrated PHY (namely read_page() and write_page() in > struct phy_driver). If DP can't be loaded (e.g. because ND is in > initramfs but DP is not), then phylib will use the generic > PHY driver GP. GP doesn't implement certain callbacks that are > needed by ND, therefore ND's probe has to bail out with an error > once it detects that DP is not loaded. > We have this problem with driver r8169 having such a dependency > on PHY driver realtek. Some distributions have tools for > configuring initramfs that consider hard dependencies based on > depmod output. Means so far somebody can add r8169.ko to initramfs, > and neither human being nor machine will have an idea that > realtek.ko needs to be added too. > > Attached patch set (two patches for kmod, one for the kernel) > allows to express this hard dependency of ND from DP. depmod will > read this dependency information and treat it like a symbol-based > dependency. As a result tools e.g. populating initramfs can > consider the dependency and place DP in initramfs if ND is in > initramfs. On my system the patch set does the trick when > adding following line to r8169_main.c: > MODULE_HARDDEP("realtek"); > > I'm interested in your opinion on the patches, and whether you > maybe have a better idea how to solve the problem. > > Heiner > Any feedback? Thanks, Heiner