Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4146124ooa; Tue, 14 Aug 2018 01:36:00 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwsFyUb4Imxm55OmgwQJY+WPLWjFEvi97RGByI4Nvtj/S+f8VGgWQZ9yqRHcTvKJFN9KAXm X-Received: by 2002:a17:902:1682:: with SMTP id h2-v6mr6653796plh.164.1534235760399; Tue, 14 Aug 2018 01:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534235760; cv=none; d=google.com; s=arc-20160816; b=ueLZe/Ij6B9/xKR2e5uaWkAOuOG0M0wHhluxFuzj7knKsDrIvdg6/jwqO6KAdV+Jus C/WLyj6cvjMIQ3+dvd2WQLzX7DSQHD5eVdlsaneoXkbTgtg4DFqGfipil/NyThJgLnoF oPTFVpwx7/nM+gepUO+CTb9ccPdYYSR1kRj9wNa6QzJXLv+/nKMc1yPytNsKnglQgg4S Xio9JoFSsYqLWbnCyX0Wk2SofnjOwLJRHe18C4yxRcQk7BVXrClQzRUl5YdgNP1AJ8Yc hxZz80TXwLU1RNMDJfPwY4DwnETelxsc9Pc1E85u7OKbhQ+CLpYFGlF03V3p2BTtC5CU NGUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=RZUIzkYPG2ljFmU6mNBTyY4zyg8uB0bo9CyuX0+3OMw=; b=msoAmUiv9YX6/ST1ScRsMDmq/Ssia2i0hYRqKpHaMOEdK7+vVyIhfSZqINbiifFUqe In8AhKpro6kQoxqpCjMBn9REZZG21KzkyaKuXLkDVZADKGKMlGIIFSzR/9EdIUhw3scv rMlMCFnhbtnGhmQXA/kzPCtqjPobSmOHu5R2j9FhuM1iP6q4llFmOHAjG9YeqNdiaXRz Osh2avo+3ogcw3dT5/dT8n2kReZAnO3Qb4h/M+vUa/SicwZxHW5B38YP+ihF+/rbdP09 YfTId87bs7XA0W1wduZDjid7IMeHO3MHzD4W7KWM7NPIbG/PMoFpT0/oYKDIHM9hFhyc 3LeA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6-v6si15980084plt.111.2018.08.14.01.35.45; Tue, 14 Aug 2018 01:36:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731105AbeHNLUx (ORCPT + 99 others); Tue, 14 Aug 2018 07:20:53 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:44821 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727986AbeHNLUx (ORCPT ); Tue, 14 Aug 2018 07:20:53 -0400 Received: by mail-qk0-f193.google.com with SMTP id v17-v6so12820912qkb.11; Tue, 14 Aug 2018 01:34:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RZUIzkYPG2ljFmU6mNBTyY4zyg8uB0bo9CyuX0+3OMw=; b=QxoMQJwCepiL/kSOrteAiNvKJXG6CBomnT3vKKohVwyyCM0gFnPATyettpaaZoKqPH Qrios9HgnfSwaY0FME4ixj5higPFGMOVP72SRafOKhFwrYf70FQWqPotSsW50YBUfHe+ WtJjgl3h9vXkVBqjFVDRJkO4CTj4IjkXMx1YShQMrLUkcjl7pxCf3IImK3QGlqRW6xZa ci9XfSXrY5IkNqwjbBne4P3z8+wvcGC7pMLYxr5/bFezScMpI2AG9ZKjTOwN3L+KFzgJ hxdjJWkA3ihy6mxoOU6qHmlw7Gl10wIKrx+qKkpZqULSU+rTSgnk4sM/2yJDV7q03GxJ Joaw== X-Gm-Message-State: AOUpUlFPrdYwQc8TO0Te7sOFxtShDO0w7k0gU3jomFJ2WntuoWior+vR 12+/3NxMWGcTjpKOsLozxfp5CKfLA078HsJxqKE= X-Received: by 2002:a37:8786:: with SMTP id j128-v6mr18133049qkd.32.1534235683910; Tue, 14 Aug 2018 01:34:43 -0700 (PDT) MIME-Version: 1.0 References: <20180813212108.2442868-1-arnd@arndb.de> <20180814105237.64b01528@ajaysk-VirtualBox> In-Reply-To: <20180814105237.64b01528@ajaysk-VirtualBox> From: Arnd Bergmann Date: Tue, 14 Aug 2018 10:34:27 +0200 Message-ID: Subject: Re: [PATCH] staging: wilc1000: revert "fix TODO to compile spi and sdio components in single module" To: ajay.kathat@microchip.com Cc: aditya.shankar@microchip.com, ganesh.krishna@microchip.com, gregkh , driverdevel , linux-wireless , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 14, 2018 at 7:22 AM Ajay Singh wrote: > > Hi Arnd, > > On Mon, 13 Aug 2018 23:20:33 +0200 > Arnd Bergmann wrote: > > > The TODO item named "make spi and sdio components coexist in one > > build" was apparently addressed a long time ago, but never removed > > from the TODO file. However, the new patch that tries to address it > > actually makes it worse again by duplicating the common parts of the > > driver into two separate modules rather than sharing them. This also > > introduces a build regression when one of the two is built-in while > > the other is a loadable module: > > Thanks for sharing your inputs and submitting patch. > I have also submitted a patch to address the compilation error[1]. > We can ignore my patch and proceed with your changes. > > [1].https://patchwork.kernel.org/patch/10563873/ That patch seems useful regardless, as it removes dead code, but I'd still prefer to revert the 9abc44ba4e2f ("staging: wilc1000: fix TODO to compile spi and sdio components in single module") commit for the other reasons I explained. > In my understanding, even when the common part is compiled separately, > the wilc1000-sdio/wilc1000-spi module still expects separate instance of > common part for each of them because of use of static variables. > > Shouldn't it be correct to compile the components required for SDIO and > SPI separately and then get rid of use of global variables to support > running of SDIO/SPI module at same time? What your patch does is to change the behavior so that for loadable modules, you get two copies of each global variable and function, but for built-in drivers, you still only get one. The old behavior was arguably better here because at least it was consistent and always shared the common part. > > In order to have multiple instances working (sdio, spi, or mixed), > > all such variables need to be dynamically allocated per instance and > > stored in 'struct wilc' or one of the structures referenced by it. > > > > Actually, I have been locally working on this patch for a while now > and I will submit a patch to avoid use of most of global and static > variable soon. Ok, very nice! Arnd