From patchwork Wed Mar 25 20:32:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 6094831 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EC422BF90F for ; Wed, 25 Mar 2015 20:32:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19B69201D3 for ; Wed, 25 Mar 2015 20:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C6C62035E for ; Wed, 25 Mar 2015 20:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbbCYUc2 (ORCPT ); Wed, 25 Mar 2015 16:32:28 -0400 Received: from mail-ig0-f171.google.com ([209.85.213.171]:34730 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbbCYUc1 (ORCPT ); Wed, 25 Mar 2015 16:32:27 -0400 Received: by igcau2 with SMTP id au2so1444179igc.1; Wed, 25 Mar 2015 13:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=xxq12iBPJB0kMuNOSdsan81V2u0TSPb3mbiryxTyC4A=; b=JNPbQJRPsNUdmZHokVeT2BEOvdxNDrS99xRhQ6mFbnr2NgwyBrqEXuFKpB/Y0YxRDF MQ5Gad4Dd7morx1IbRVbfoAD0YavlL9d86YH+CcOYmVHbej/KgIzaSmuuXhZ4Oq5XZr2 UQ8PPCpDFIFr0Ts/1UTHrd+wGCmjRulmw2V9AzdqmIRO4TPy33RRgX/ZswW0OxfeKpHv FO3FRelruEFU7Gjd/F876MWaoqfimEVxKyGaRfFwtWRGGWMKb/u+rHUNtKAPPG0GM3/d CB3XFj3LRpQNgAgBiv5PrK+uIv+NzFlw3MaHKo8+ayKwXa1drdI74oC87IpGlVu+kWDe cEzQ== X-Received: by 10.50.143.36 with SMTP id sb4mr31941848igb.0.1427315546580; Wed, 25 Mar 2015 13:32:26 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:3068:4db6:86bf:61ac]) by mx.google.com with ESMTPSA id ie15sm2126018igb.12.2015.03.25.13.32.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Mar 2015 13:32:24 -0700 (PDT) Date: Wed, 25 Mar 2015 13:32:22 -0700 From: Dmitry Torokhov To: Mark Brown Cc: Geert Uytterhoeven , Grant Likely , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] spi: of: do explicitly request modules for of-registered devices Message-ID: <20150325203222.GA8845@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Trying to register an SPI device asynchronously (via async_schedule() call) results in an ugly complaint from request_module() warning about potential deadlock (because request_module tries to wait for async works to complete, the caller is also an async work in this case). While we could try to switch to using request_module_nowait(), other buses, as well as SPI itself when not using device tree, do not try to load modules explicitly, but rather rely on the standard infrastructure (such as udev) to execute module loading. There is no reason why SPI OF-described devices should be treated differently. Signed-off-by: Dmitry Torokhov --- Mark, I chatted with Grant who I believe added the code originally and he said he does not recall a good reason for it to actually be there. Thanks! drivers/spi/spi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c64a3e5..102a9e6 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -16,7 +16,6 @@ */ #include -#include #include #include #include @@ -1359,7 +1358,6 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc) spi->dev.of_node = nc; /* Register the new device */ - request_module("%s%s", SPI_MODULE_PREFIX, spi->modalias); rc = spi_add_device(spi); if (rc) { dev_err(&master->dev, "spi_device register error %s\n",