Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp523911pxk; Wed, 2 Sep 2020 07:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnoeCGfhiySzIt4FQvG5rPZyXZe3Wk10uCMfBCD2GFNNuLsyuKqN4e2Hn1C2upTFrnJhWM X-Received: by 2002:aa7:cb0a:: with SMTP id s10mr493942edt.134.1599058698963; Wed, 02 Sep 2020 07:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599058698; cv=none; d=google.com; s=arc-20160816; b=tw4gGFUOGyWpFgVz26LXllsd9gUBQ16tQvtLf5hf2AXueFvdOu3CU2LcrRU+d6lwVk VtGHDL6e3A/JnRmIo/it88lPymDbVNdgE8ByAs7ZmCJL67AYacDBrDqDEDQ9vu3f5irf QIU2rQTjuJ0ZjierAMbwh8/7CRjzNxaX3iupZE/kUOVdAohiAZA0YbP92hEarSWn0amO IjSuUIekOUIg4AaS93jbwJX9FyJ33XYKrJawAv9X7zk5OkvLVVe8SfwYaE1CdzJk1LUF GTOkGYPI//uUC5/PW4jvPIkeyKloE9+RM08UarPyD5J4kWPQDaoTV6qxi3wBCLMA+mh3 bFaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=OuSM0N2of7HW+VerV3RpOnt//Hy9Pp+ppTBHIHjKgUQ=; b=PFbP1JjnsnpclRX5As5fTKUnnpjvoSiRTvLH9fHqR5Oe7g03gUbTkuyZ5zBiCg3rRo v+nXkHl0ybSIWiyv9A3CZHP3PRYyqFKY3D8qg89B0RQFP5NNehuDgcNEDIHxehK0TLMn AeDqP0CECtoKQt5bYE3UH/aWt9lRRjaX3haizzO4RpkeFKFDINomrLoRf34doL3pIJYH jR2TaQ8p9RvIITU+wE2/VzphmEet0YKLW//7WxaTuKNU0EbulhcpaWAWRSBRI0M697Ic Cj7V51iktTdB02c6LFDffasbhGdgKcE5LMgLQ/zL1wItSH/pAbkaAQeA1vyKbW7i3Q6P k8aQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si2698642ejb.57.2020.09.02.07.57.56; Wed, 02 Sep 2020 07:58: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbgIBO5R (ORCPT + 99 others); Wed, 2 Sep 2020 10:57:17 -0400 Received: from netrider.rowland.org ([192.131.102.5]:60707 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726406AbgIBO5C (ORCPT ); Wed, 2 Sep 2020 10:57:02 -0400 Received: (qmail 624961 invoked by uid 1000); 2 Sep 2020 10:57:01 -0400 Date: Wed, 2 Sep 2020 10:57:01 -0400 From: Alan Stern To: Greg Kroah-Hartman Cc: himadrispandya@gmail.com, dvyukov@google.com, linux-usb@vger.kernel.org, perex@perex.cz, tiwai@suse.com, stern@rowland.harvard.ed, linux-kernel@vger.kernel.org, marcel@holtmann.org, johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH 04/10] USB: core: hub.c: use usb_control_msg_send() in a few places Message-ID: <20200902145701.GA624583@rowland.harvard.edu> References: <20200902110115.1994491-1-gregkh@linuxfoundation.org> <20200902110115.1994491-5-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200902110115.1994491-5-gregkh@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 02, 2020 at 01:01:06PM +0200, Greg Kroah-Hartman wrote: > There are a few calls to usb_control_msg() that can be converted to use > usb_control_msg_send() instead, so do that in order to make the error > checking a bit simpler and the code smaller. > > Cc: Alan Stern > Signed-off-by: Greg Kroah-Hartman One problem in this patch... > @@ -3896,27 +3875,14 @@ static int usb_req_set_sel(struct usb_device *udev, enum usb3_link_state state) > if (u2_pel > USB3_LPM_MAX_U2_SEL_PEL) > u2_pel = USB3_LPM_MAX_U2_SEL_PEL; > > - /* > - * usb_enable_lpm() can be called as part of a failed device reset, > - * which may be initiated by an error path of a mass storage driver. > - * Therefore, use GFP_NOIO. > - */ > - sel_values = kmalloc(sizeof *(sel_values), GFP_NOIO); > - if (!sel_values) > - return -ENOMEM; > - > - sel_values->u1_sel = u1_sel; > - sel_values->u1_pel = u1_pel; > - sel_values->u2_sel = cpu_to_le16(u2_sel); > - sel_values->u2_pel = cpu_to_le16(u2_pel); > + sel_values.u1_sel = u1_sel; > + sel_values.u1_pel = u1_pel; > + sel_values.u2_sel = cpu_to_le16(u2_sel); > + sel_values.u2_pel = cpu_to_le16(u2_pel); > > - ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), > - USB_REQ_SET_SEL, > - USB_RECIP_DEVICE, > - 0, 0, > - sel_values, sizeof *(sel_values), > - USB_CTRL_SET_TIMEOUT); > - kfree(sel_values); > + ret = usb_control_msg_send(udev, 0, USB_REQ_SET_SEL, USB_RECIP_DEVICE, > + 0, 0, &sel_values, sizeof(sel_values), > + USB_CTRL_SET_TIMEOUT); This effectively changes GFP_NOIO to GFP_KERNEL. Probably you should leave this particular call alone. Alan Stern