Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2436393iob; Fri, 20 May 2022 09:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvt+itzkitBrZzeIIprhyy4/Yav4ySR1no2Uwkw1WDrjaaqUOBSELWIJloOP2rNvO7UKWE X-Received: by 2002:a05:6402:1453:b0:42a:ae31:310c with SMTP id d19-20020a056402145300b0042aae31310cmr11473256edx.382.1653063484615; Fri, 20 May 2022 09:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653063484; cv=none; d=google.com; s=arc-20160816; b=yV12vgN1DxN0m5DTEMqJs1zqLFM3N+dLsDBOU5tNfr+yU5tWuzGgCvIGp4G5fqpPXM dw2R3ukkIUcpxpzk7WYnBjD5SW8VBVgogbqGNjxEImT90TcxhvKBsO89gGeRJxgUte62 trNwzKUaesFHwJ7CsR+bNn0D68GpzaQ6Ef3/SSE4lR2mQqw0/A9UiifiNp92pNlElGuK 0PodrOOkdfFTIa78OGY+3vJ7Yww/r7SPTFFvH0BcnIr9fHkzrKf8FZDhj9u4XwVKo+gB ADYne3wRP8QgY8Lkl8/9AVeK1nw848J7Gy/3ukWm1wsx95sqTs4UaxSCn0iIaIfWg3Lv 8yTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=k4TaXOe7Lwo+CV82+bLt4wFrTLilH5zJy3rK/5JlxKc=; b=e1CdEthKJR17DFrMCboUU6my1TnZb7BZhFS1knv2Wy3lKzev1pHAcVS+sWQVfQDa2T G2F4pqpwGrusRWSEtIdnbnYzQvX6vFTxI/hqUlDcTJ6U64+iyzx+wPiaHJiSjF5jvDx3 u9J2A22US2MpO67z5XQzXW8SJU4fRLVgnEPLBWfqnQMdNtMbShrUfoXTuccEXKA5hWzi Dy06/6D9uK6PF+F8A9T9JX61Rs/xi+g7w5sXsA41xgyk/zWQaPkyk1R/s91YVo2TJTos BHvQsYNDY0XG3juHpwtjLjueNFf3Axx6luZRB/FRw+aubSmSweg+4XtxiwIpULM2DBvg gsnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Tvcegh9k; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js16-20020a17090797d000b006e1442ff695si8756361ejc.590.2022.05.20.09.17.45; Fri, 20 May 2022 09:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Tvcegh9k; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351386AbiETQJT (ORCPT + 69 others); Fri, 20 May 2022 12:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351396AbiETQJR (ORCPT ); Fri, 20 May 2022 12:09:17 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E8A217CE78; Fri, 20 May 2022 09:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653062956; x=1684598956; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=k4TaXOe7Lwo+CV82+bLt4wFrTLilH5zJy3rK/5JlxKc=; b=Tvcegh9kDtmAk+/wt8QwA9p1TQ8Eb3lVTHdL7luMCPtHQlCbnQ5MVveG cBmRsk4zfUj91/zsaa5zoaq/gbBkREjG8cC36f2+9HGb0J8g/4t1Vm+AT UOCQRCffgn0p3i2FiQnM43fMryf+VYjhF5ztE3uxNhDwVBT9hXZ6sJMoT M=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 20 May 2022 09:09:16 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 09:09:15 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 20 May 2022 09:08:55 -0700 Received: from [10.110.24.32] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 20 May 2022 09:08:53 -0700 Message-ID: Date: Fri, 20 May 2022 09:08:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH net v2] net: wireless: marvell: mwifiex: fix sleep in atomic context bugs Content-Language: en-US To: CC: Kalle Valo , , , , , , , , , , , References: <20220519135345.109936-1-duoming@zju.edu.cn> <87zgjd1sd4.fsf@kernel.org> <699e56d5.22006.180dce26e02.Coremail.duoming@zju.edu.cn> <18852332-ee42-ef7e-67a3-bbd91a6694ba@quicinc.com> <4e778cb1.22654.180decbcb8e.Coremail.duoming@zju.edu.cn> From: Jeff Johnson In-Reply-To: <4e778cb1.22654.180decbcb8e.Coremail.duoming@zju.edu.cn> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/19/2022 5:08 PM, duoming@zju.edu.cn wrote: > Hello, > > On Thu, 19 May 2022 08:48:44 -0700 Jeff Johnson wrote: > >>>>> There are sleep in atomic context bugs when uploading device dump >>>>> data on usb interface. The root cause is that the operations that >>>>> may sleep are called in fw_dump_timer_fn which is a timer handler. >>>>> The call tree shows the execution paths that could lead to bugs: >>>>> >>>>> (Interrupt context) >>>>> fw_dump_timer_fn >>>>> mwifiex_upload_device_dump >>>>> dev_coredumpv(..., GFP_KERNEL) >> >> just looking at this description, why isn't the simple fix just to >> change this call to use GFP_ATOMIC? > > Because change the parameter of dev_coredumpv() to GFP_ATOMIC could only solve > partial problem. The following GFP_KERNEL parameters are in /lib/kobject.c > which is not influenced by dev_coredumpv(). > > kobject_set_name_vargs > kvasprintf_const(GFP_KERNEL, ...); //may sleep > kstrdup(s, GFP_KERNEL); //may sleep Then it seems there is a problem with dev_coredumpm(). dev_coredumpm() takes a gfp param which means it expects to be called in any context, but it then calls dev_set_name() which, as you point out, cannot be called from an atomic context. So if we cannot change the fact that dev_set_name() cannot be called from an atomic context, then it would seem to follow that dev_coredumpv()/dev_coredumpm() also cannot be called from an atomic context and hence their gfp param is pointless and should presumably be removed. /jeff