Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F4E5C433FE for ; Tue, 30 Nov 2021 08:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239737AbhK3Isr (ORCPT ); Tue, 30 Nov 2021 03:48:47 -0500 Received: from mail.loongson.cn ([114.242.206.163]:45244 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239664AbhK3Isq (ORCPT ); Tue, 30 Nov 2021 03:48:46 -0500 Received: from [10.180.13.93] (unknown [10.180.13.93]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxismT5KVh97YBAA--.3687S2; Tue, 30 Nov 2021 16:45:14 +0800 (CST) Subject: Re: [PATCH v2 1/2] modpost: file2alias: fixup mdio alias garbled code in modules.alias To: Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Masahiro Yamada , Michal Marek , Nick Desaulniers , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org References: <1637919957-21635-1-git-send-email-zhuyinbo@loongson.cn> From: zhuyinbo Cc: Russell King , Andrew Lunn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, zhuyinbo@loongson.cn Message-ID: Date: Tue, 30 Nov 2021 16:45:07 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9AxismT5KVh97YBAA--.3687S2 X-Coremail-Antispam: 1UD129KBjvJXoWxGw17XF1xGFy8Jr1xZF17trb_yoW5Xr4UpF W3GFy5KFWkGF429a1F93WUWryUXw47Kr95Wa1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org 在 2021/11/26 下午6:21, Heiner Kallweit 写道: > On 26.11.2021 10:45, Yinbo Zhu wrote: >> After module compilation, module alias mechanism will generate a ugly >> mdio modules alias configure if ethernet phy was selected, this patch >> is to fixup mdio alias garbled code. >> >> In addition, that ugly alias configure will cause ethernet phy module >> doens't match udev, phy module auto-load is fail, but add this patch >> that it is well mdio driver alias configure match phy device uevent. >> > I think Andrew asked you for an example already. > For which PHY's the driver isn't auto-loaded? I test that use marvell phy, another colleague use motorcomm phy,  which auto load function was all fail. and I need to emphasize one thing that the mdio auto load issue is generally issue, not special phy issue. > > In addition your commit descriptions are hard to read, especially the > one for patch 2. Could you please try to change them to proper English? > Not being a native speaker myself .. I had changed commit information as v3 version, please you check. >> Signed-off-by: Yinbo Zhu >> --- >> Change in v2: >> Add a MDIO_ANY_ID for considering some special phy device >> which phy id doesn't be read from phy register. >> >> >> include/linux/mod_devicetable.h | 2 ++ >> scripts/mod/file2alias.c | 17 +---------------- >> 2 files changed, 3 insertions(+), 16 deletions(-) >> >> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h >> index ae2e75d..7bd23bf 100644 >> --- a/include/linux/mod_devicetable.h >> +++ b/include/linux/mod_devicetable.h >> @@ -595,6 +595,8 @@ struct platform_device_id { >> kernel_ulong_t driver_data; >> }; >> >> +#define MDIO_ANY_ID (~0) >> + >> #define MDIO_NAME_SIZE 32 >> #define MDIO_MODULE_PREFIX "mdio:" >> >> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c >> index 49aba86..63f3149 100644 >> --- a/scripts/mod/file2alias.c >> +++ b/scripts/mod/file2alias.c >> @@ -1027,24 +1027,9 @@ static int do_platform_entry(const char *filename, >> static int do_mdio_entry(const char *filename, >> void *symval, char *alias) >> { >> - int i; >> DEF_FIELD(symval, mdio_device_id, phy_id); >> - DEF_FIELD(symval, mdio_device_id, phy_id_mask); >> - >> alias += sprintf(alias, MDIO_MODULE_PREFIX); >> - >> - for (i = 0; i < 32; i++) { >> - if (!((phy_id_mask >> (31-i)) & 1)) >> - *(alias++) = '?'; >> - else if ((phy_id >> (31-i)) & 1) >> - *(alias++) = '1'; >> - else >> - *(alias++) = '0'; >> - } >> - >> - /* Terminate the string */ >> - *alias = 0; >> - >> + ADD(alias, "p", phy_id != MDIO_ANY_ID, phy_id); >> return 1; >> } >> >>