Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2165965pxy; Mon, 2 Aug 2021 22:18:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvzNr+dSR8AzL88hs/RQG8YTa7BSPWVPwDsaaRag1VbmAsPjbnFqwVQtENHrJbqHH1IJ+w X-Received: by 2002:a92:cecf:: with SMTP id z15mr40563ilq.225.1627967898252; Mon, 02 Aug 2021 22:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627967898; cv=none; d=google.com; s=arc-20160816; b=pNDbjTnut7tW4T+Q2SkbNXFgBDz/9CLUlzAkGeCCa1M4z3xt1rJvV7m/zc2iUo+s5i 8R8gORrAGuKJqeH3w7jWVGuAVeW71mbIN5UkzbkxKWxnIgQAaYRLeGny3k0plWs5QCv8 KPKzzU+1nVzkrQVR4ZiG69RtC0SxUHJ0ksIgQ8iasQOV3YYiQcKHTNZvgh3R6t8jzPoA QF32IlHyW6nLpmsWll1LPa046DltApcqAKngjyC2MIEno6lhYtQVfqYS+5OaptOAnxUE x8g78akBXaKHSurFNgdRf+oJ5hehoVdZLxU9yA+bkx9AXK7m1Nz8Mu1NXI0uUoFTcsHX SU8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fvkMDyJLhtTgtLqNhwP3FwNfBTd/rsh1xEY/iZZyu/M=; b=UdN/aMvTG4HV81kiZiKT7cBbMia4iGjwco6g5sw8Xo+yAOTuC0E8QFjyCOJ31cejiu 6zuNsw71JJGicQpc7p+T6YESGrDCUqrTYSOvP5KcOp5eNmuYJFBDq2tG5SupQQxvOt4Y Tudr9C239YeaE9AOABT7XTkjwbNOSzeb2wNWx3Yrs6R6PFN/TeplIROvKJNryQjp4nhX SOD39EeKonJxKHHPX30raVsSuBrs+60THDY+DOAsQ8mfQrzubN/KOyJpD+I3ZJvTksfi VfF5KwEgFFCLEjmxwa3QDOXmV6/3FCCdtE+VUuI404AgOhQOfAKq3DUeLO/KvgjC1hBA 13OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UFClKNbE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si2205655ill.67.2021.08.02.22.18.05; Mon, 02 Aug 2021 22:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UFClKNbE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233784AbhHCFQZ (ORCPT + 99 others); Tue, 3 Aug 2021 01:16:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:33132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhHCFQZ (ORCPT ); Tue, 3 Aug 2021 01:16:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A2F96023F; Tue, 3 Aug 2021 05:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627967774; bh=BD3EfVSm5ZmZYCUw/owaWZws+ZrwBusi9GEntH+libY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UFClKNbEqUL85oHwHn4xjatoR4E5iYO4AuqK231Pcn41tJtZ+mdm7ik9BfaNHFIey lZJfe/pbwnpYRWxeMg+BVJQDNcKSpBG0xKTOhr8JOhwdpnW1VO17dl8McybJh3WkBN uiwMJ7bkXSk7f27vFyNnqzQsz+qXdNfda93c+zdA= Date: Tue, 3 Aug 2021 07:16:12 +0200 From: Greg Kroah-Hartman To: Salah Triki Cc: Dan Carpenter , Amey Narkhede , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: gdm724x: get lock before calling usb_[disable|enable]_autosuspend() Message-ID: References: <20210802223703.GA1425480@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210802223703.GA1425480@pc> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 02, 2021 at 11:37:03PM +0100, Salah Triki wrote: > Based on the documentation of usb_[disable|enable]_autosuspend(), the > caller must hold udev's device lock. > > Signed-off-by: Salah Triki > --- > drivers/staging/gdm724x/gdm_usb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c > index 54bdb64f52e8..31b3b3e563c8 100644 > --- a/drivers/staging/gdm724x/gdm_usb.c > +++ b/drivers/staging/gdm724x/gdm_usb.c > @@ -846,7 +846,9 @@ static int gdm_usb_probe(struct usb_interface *intf, > udev->intf = intf; > > intf->needs_remote_wakeup = 1; > + usb_lock_device(usbdev); > usb_enable_autosuspend(usbdev); > + usb_unlock_device(usbdev); > pm_runtime_set_autosuspend_delay(&usbdev->dev, AUTO_SUSPEND_TIMER); > > /* List up hosts with big endians, otherwise, > -- > 2.25.1 Please look at the other places where this function is called and note that the pattern you have added here is not used in those situations either, so perhaps this change is not correct at all. thanks, greg k-h