lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 431/917] net: tulip: winbond-840: fix build for UML
    Date
    From: Randy Dunlap <rdunlap@infradead.org>

    [ Upstream commit a3d708925fcca1a2f7219bc9ce93e6341f85c1e0 ]

    On i386, when builtin (not a loadable module), the winbond-840 driver
    inspects boot_cpu_data to see what CPU family it is running on, and
    then acts on that data. The "family" struct member (x86) does not exist
    when running on UML, so prevent that test and do the default action.

    Prevents this build error on UML + i386:

    ../drivers/net/ethernet/dec/tulip/winbond-840.c: In function ‘init_registers’:
    ../drivers/net/ethernet/dec/tulip/winbond-840.c:882:19: error: ‘struct cpuinfo_um’ has no member named ‘x86’
    if (boot_cpu_data.x86 <= 4) {

    Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: linux-um@lists.infradead.org
    Cc: Jeff Dike <jdike@addtoit.com>
    Cc: Richard Weinberger <richard@nod.at>
    Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
    Link: https://lore.kernel.org/r/20211014050606.7288-1-rdunlap@infradead.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/dec/tulip/winbond-840.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/dec/tulip/winbond-840.c b/drivers/net/ethernet/dec/tulip/winbond-840.c
    index 85b99099c6b94..5babcf05bc2f1 100644
    --- a/drivers/net/ethernet/dec/tulip/winbond-840.c
    +++ b/drivers/net/ethernet/dec/tulip/winbond-840.c
    @@ -877,7 +877,7 @@ static void init_registers(struct net_device *dev)
    8000 16 longwords 0200 2 longwords 2000 32 longwords
    C000 32 longwords 0400 4 longwords */

    -#if defined (__i386__) && !defined(MODULE)
    +#if defined (__i386__) && !defined(MODULE) && !defined(CONFIG_UML)
    /* When not a module we can work around broken '486 PCI boards. */
    if (boot_cpu_data.x86 <= 4) {
    i |= 0x4800;
    --
    2.33.0


    \
     
     \ /
      Last update: 2021-11-16 01:40    [W:4.227 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site