Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3487110pxj; Tue, 15 Jun 2021 01:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkwSOfI1UDdKegLm6AdIItK8A1Wmv+BifQv57RbyWK6n81jenKDVY0yFUw2ywT6B9SlVMQ X-Received: by 2002:a17:907:2150:: with SMTP id rk16mr20365799ejb.166.1623747176598; Tue, 15 Jun 2021 01:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623747176; cv=none; d=google.com; s=arc-20160816; b=cIJ2w/A9mJMHD42gdkb/nhnvBJoLg0nES7R97dcoCmUSOIUYJcQpjyvJsV3z3a3RXL P4mjzEPst7R0a3VvdRIR6p6OYJxanQQ9LOO1lU52O8nIFyOJZGlHg9ZPyeGstHLdEUUB jlw1PFmNRLsWowSCx5SEfxer/e0q8SLaoNj7OMPhF27wE8fsH29Ym69PmWeyQ6v3rfLC qMtAmnYG9nb2RDDpDi5AMLp7DROy1HYUE6AQS6x+tBfoj7i4GPxYW0HZsuqhDm83NFOi sdiiW+rKjemyvm76CqqLYgZFuT2IEwQYAnkMz0z0rQrMy17yKSpSk3NRaDGSpaK8kVke BNKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=x1XbdLAsygRvqlWOnjmLLii0RM3GmMtx0nRDrJMPKeg=; b=D4aWwvWzQu06cgAU49AUVRBWBDp4oPQov1WJw2wSrznoWJPspa1QJwXkav3JaP0ZJh dlLIbzMB2joBQnhLKwqROrLrqVsG80CMxo+Oi2JfjPG4An6q9WebfC1qysBqA0qxtxAn GSAywFs4rXFoh2Fjej9irCmsH97GLjQx37T7C9faZDyVvDExPoQkPz6XzvXBGQ1XAMWP vf/pW708mIddoQfPkidqVOBTkxRfGkHT2DUHG5o2frOyJTPPH4XgFSwRqeBt+FcRPYnH fJYskZXz9BN3+XDzlY8rBO1vOwy4zUwlPBEhhte7ufyGpS5euqESfFGiKzKvlCg+zRPn r40g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hQF8aVQc; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m25si13908424ejb.570.2021.06.15.01.52.34; Tue, 15 Jun 2021 01:52:56 -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=@kernel.org header.s=k20201202 header.b=hQF8aVQc; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231191AbhFOIxN (ORCPT + 99 others); Tue, 15 Jun 2021 04:53:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:44210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbhFOIxF (ORCPT ); Tue, 15 Jun 2021 04:53:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6136961420; Tue, 15 Jun 2021 08:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623747061; bh=9ltkYt84XHRCjiFpqpJbCWEVaJ+GIPrMxTP71kRt3X0=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=hQF8aVQc38/+jJr0BhRdoXZadH20RoSWGiEnAJyqz54m24IN+JXfMsAPyb/hJLTwL sukira08UzgF4THnSI9qHsAw40DyMvObCdXOcfWQXu0eq7Nd+6KMaWFlazHo3sYsSc gnk/ny/AI/p31G5laIzsXLw0SikV++zaJxYqNl5hpdVyx6AMlntqkfZAt7+gfuFnE+ XDuneRi7wTFcYOe13GMoPRz3CQxSKSU6rmH+JaVCzqeq4TvQfNtv2S05dRzgSvACKk Ww5lyYsb7CWZLgIyyvrK4iM/0osfj9e2gCcnZhQQf8x9Fw/A9FfyZ/ccVA/e4ZlVO5 vrmJZDW7XB7VQ== Date: Tue, 15 Jun 2021 10:50:58 +0200 (CEST) From: Jiri Kosina To: Hyeonggon Yoo <42.hyeyoo@gmail.com> cc: Benjamin Tissoires , linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: usbkbd: Avoid GFP_ATOMIC when GFP_KERNEL is possible In-Reply-To: <20210529100357.GA46765@hyeyoo> Message-ID: References: <20210529100357.GA46765@hyeyoo> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 29 May 2021, Hyeonggon Yoo wrote: > usb_kbd_alloc_mem is called in usb_kbd_probe, which is > not in atomic context. So constraints can be relaxed here. > > Use GFP_KERNEL instead of GFP_ATOMIC. > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > --- > drivers/hid/usbhid/usbkbd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c > index e22434dfc9ef..df02002066ce 100644 > --- a/drivers/hid/usbhid/usbkbd.c > +++ b/drivers/hid/usbhid/usbkbd.c > @@ -239,11 +239,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) > return -1; > if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) > return -1; > - if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma))) > + if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma))) > return -1; > if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) > return -1; > - if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) > + if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma))) > return -1; > > return 0; Applied, thanks. -- Jiri Kosina SUSE Labs