Received: by 10.213.65.68 with SMTP id h4csp2730901imn; Mon, 9 Apr 2018 08:09:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx49bBp2TYMAQOdXC3QSfTPfbXah6ylMq82mXZATPU1gr3x8g3uFT8F9Wwz3AgHbNNhAnqwU0 X-Received: by 10.99.127.88 with SMTP id p24mr10984568pgn.226.1523286591666; Mon, 09 Apr 2018 08:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523286591; cv=none; d=google.com; s=arc-20160816; b=WI8NkkrZVGYUUelMNOEu2wj0hEdWnRMBF9x2TEmy4nDAymQyCaY2/wCpgPqIFF3cAI nDK6O7sfOyqs48+av5nwzQVGzHyV0Kn2DXy/xTHFjxzqGJBkUZWxQqbcvRdUew0O1DEQ oRngwqnEvAVK4Gigfk0+1gzvQrgDlpe2IS1ruLJFK8VoicVMa3NpO22XvuXysetYZl8J Z9K79iuxmvErSB1HEAXHYH1p884moCUdPO4asARfr7/ZxDeBRV3VrA2FLov6y6bOjhdL 1JZzGP72DSknDFLWkXJD503CbSLcXbwbVJHz9ULWUtZpqEPWof6q9aHwG3kcaizWC3+T vx3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=HEA4yhbWURGN1SuyljplXkLYK/2wPIn7mLIwgffK+bk=; b=h7j/L/K0D7zb7bAkAZMJLkgqbeoWKbqaLe6dCre0zRiiVb9aNiSSN+N2uKvN8NTqf2 WxlrIgQvQdrtECNkRi+tVX1AN0cKD+HVb2SA+Ryn5OTqLrzPU1dG7U7/+6vt9N+M9GSu 92QrKx7s/jOS+U370+EojmQmyQ+2BaMx9OPBXmxlSobjXseah84VvuMM1gjQqNUvzJap QazpMmHM6UF4DFChGYracoRaMj8/vs7XSSaapF0xBqWYS/P9VzQ0kHJedDJYCCiL1SHE OgHBvrOjPtiiAQM05wW6Rcviy3H+pN4jv6uElCDHdbKsJIKHvvbIoe4n0ESC4kdnBNdS U5yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I304OD2+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si365388pfk.224.2018.04.09.08.09.14; Mon, 09 Apr 2018 08:09:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I304OD2+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753162AbeDIPEh (ORCPT + 99 others); Mon, 9 Apr 2018 11:04:37 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:44946 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbeDIPEd (ORCPT ); Mon, 9 Apr 2018 11:04:33 -0400 Received: by mail-pg0-f66.google.com with SMTP id v26so358165pge.11 for ; Mon, 09 Apr 2018 08:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=HEA4yhbWURGN1SuyljplXkLYK/2wPIn7mLIwgffK+bk=; b=I304OD2+fTvn2hkMxZMvdbqA3qMOeq8IYhHIg1Io9gisglknOBw2z9tfJNQ1LL3LZg 9MkCgWczisKW8+SHmUYc79jcJb842ePGdfTMw6xAAa4e9/4CqGoti1ffy1eB2PfB0gYB Jz8cfXHN2C1GHd/GvjMNJ/zoC1G+ngTN430HevC8y9TH9Jch8HofGnm6F0wj2oHa6qKe L/k+tsLqstpzuVYVEPkwiAha+hVEWCneTuBos0eQ1w4X+6A2E4vbEeJGPuYWWzueSEqm qanajC949nXAt3tXbx95nVbsmlUwO277zHmwMXP/j1Byq0SFC/K2tYDhuGAmJJxTAV3s pyOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HEA4yhbWURGN1SuyljplXkLYK/2wPIn7mLIwgffK+bk=; b=rHvbjCi7X/uR1YLMjgQ6M8JtLKSq648eRcJJTwTb5zG4W+KHbrdnMB6P/Uw1xz/y8d SS356pxWFbMEecFwFa3bcdvV8hvbCy/q/fosn6MeaYVhyY/mUNM6mNMS1M57309rlWix 6Yh8eOxcn32KZUghoDd+quKJIkTdIdTY/b6GdYYJhGlQbtpUZeClhsxzT0AMmMqBWcUj 76EGEFZLZ+Bz/anfnW87r9BXGU40vfFbChV0m9UL0YkqNLfXgBvko29p2tldw6a0WSxF DERV9571QScHgBQ3goLV1z64r2DNd+az5WYMgvfYztBxToXRq0+FtTDnLX4p0xMVz/ig x3wg== X-Gm-Message-State: ALQs6tCW8/5/myoGKZEVbGOeReqYydn4BJFYmdSxy+OD0MnaPzaun3Nu Do8kSutNU6IobUBFRQfPHCI= X-Received: by 10.167.134.1 with SMTP id p1mr13616942pfn.77.1523286272766; Mon, 09 Apr 2018 08:04:32 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id m185sm1619248pfm.118.2018.04.09.08.04.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 08:04:32 -0700 (PDT) From: Jia-Ju Bai To: boris.ostrovsky@oracle.com, jgross@suse.com, gregkh@linuxfoundation.org Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 4/4] xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in xen_pcibk_config_quirks_init Date: Mon, 9 Apr 2018 23:04:25 +0800 Message-Id: <1523286265-26501-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org xen_pcibk_config_quirks_init() is never called in atomic context. The call chains ending up at xen_pcibk_config_quirks_init() are: [1] xen_pcibk_config_quirks_init() <- xen_pcibk_config_init_dev() <- pcistub_init_device() <- pcistub_seize() <- pcistub_probe() [2] xen_pcibk_config_quirks_init() <- xen_pcibk_config_init_dev() <- pcistub_init_device() <- pcistub_init_devices_late() <- xen_pcibk_init() pcistub_probe() is only set as ".probe" in struct pci_driver. xen_pcibk_init() is is only set as a parameter of module_init(). These functions are not called in atomic context. Despite never getting called from atomic context, xen_pcibk_config_quirks_init() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. Signed-off-by: Jia-Ju Bai --- drivers/xen/xen-pciback/conf_space_quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xen-pciback/conf_space_quirks.c b/drivers/xen/xen-pciback/conf_space_quirks.c index 7476791..e3df3f9 100644 --- a/drivers/xen/xen-pciback/conf_space_quirks.c +++ b/drivers/xen/xen-pciback/conf_space_quirks.c @@ -94,7 +94,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev) struct xen_pcibk_config_quirk *quirk; int ret = 0; - quirk = kzalloc(sizeof(*quirk), GFP_ATOMIC); + quirk = kzalloc(sizeof(*quirk), GFP_KERNEL); if (!quirk) { ret = -ENOMEM; goto out; -- 1.9.1