Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1921730ybc; Wed, 20 Nov 2019 06:17:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwq0/QDnKDyfxRsd9Pr8+BSEAfZ4DYbcpz73Mkoul+7Ofb7RSiWFZjFOfl1UrbvUXQH8WaC X-Received: by 2002:a17:906:6d05:: with SMTP id m5mr5739387ejr.102.1574259431628; Wed, 20 Nov 2019 06:17:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574259431; cv=none; d=google.com; s=arc-20160816; b=cwY9ibm5+01VbuXppOD/rGff0n6SBrVkbSthIfbRGLZqCE1h9VvR/s5zg4vgC1NT/h YRXgcPNAD8mwGVeKXaple5Hh9YMDBPpINHIIGVEdKC3cZKqJLyqjS/SYcwbY7hGvrdUo HBRkXOTJcUDuR8jejMLyGWJWaQhI49S5tmlHLYkbwZx67As1x4qvwlkfetr2TYkfUK3a 6nyBi6UhuxlG1S7WFesfvqRpyqre3riYfnmuuVEYKMe5XAeSKlzoOv70o9Cwo9vUMCaL MFusb+J24ItshO3IrLyZKaxGsnQ2hRFf+TxnIQNaTFjdhxsktyFqa49GZD/P/OCOjaSD 1FRQ== 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:dkim-signature; bh=1412RSwfvCRdJ2NpuX8DiOw4rnhhHeXrJydFlaToQbo=; b=gFjX6pHM53HNZ73FlBzHerf/9b/h5rHH10S4aWxQkh3Nb8pkx/Bi5NRiBF9HthmGqz ZYHe779HusVFw1pWK4ZJS/MNmgTuK9VFZzRnbVgkiPWrIYsrt+ZLI+LmU0LT2qKXd+z+ dqnZIeZDQ7mLwlofRPjDt0LmJFDnJ2aJlVK8BCakjF9voHWFOOuoikcR6kaL6YuJ0Ccw hJYw5tqXqTMnv61QAltp+PcAFtH9ShabB3uRjtXTbylOnB1G3nObrAYy294FONh/kaEe A80Qgpi8Jrvmil12AXHOv2kerUNzCPV7hNbNEFOuEIp8oBZkZs5SDeA3p1pWmIF2fq9r hbeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WWxURQer; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h24si16648334ejd.145.2019.11.20.06.16.47; Wed, 20 Nov 2019 06:17:11 -0800 (PST) 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=@kernel.org header.s=default header.b=WWxURQer; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731616AbfKTOCP (ORCPT + 99 others); Wed, 20 Nov 2019 09:02:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:59804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727988AbfKTOCO (ORCPT ); Wed, 20 Nov 2019 09:02:14 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADDEE2235D; Wed, 20 Nov 2019 14:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574258534; bh=jfz7QwK1/Lbu7Y8QvbmT43l6h208/pDDBUvroUJR59A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WWxURQera4DoHBCY2JpT7xtu3u6iqH4TRSUGv8GlKCeRWIDmS+FtWsBylVOFNcuFC oN5pgVWzzI/bVLIu1bNkXccHEwA9Ihcj7JFk1z4tpOQ5cAh72DeM8kmRBiXZ36sEs9 10rf73NPkX6sE+J9lVOMDSr3gOC6Gx3T5l+rujfA= Date: Wed, 20 Nov 2019 15:02:11 +0100 From: Greg Kroah-Hartman To: patrick.rudolph@9elements.com Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Alexios Zavras , Allison Randal , Stephen Boyd , Julius Werner , Samuel Holland Subject: Re: [PATCH 1/2] firmware: google: Expose CBMEM over sysfs Message-ID: <20191120140211.GA2935300@kroah.com> References: <20191120133958.13160-1-patrick.rudolph@9elements.com> <20191120133958.13160-2-patrick.rudolph@9elements.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191120133958.13160-2-patrick.rudolph@9elements.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 20, 2019 at 02:39:46PM +0100, patrick.rudolph@9elements.com wrote: > +static int cbmem_probe(struct coreboot_device *cdev) > +{ > + struct device *dev = &cdev->dev; > + struct cb_priv *priv; > + int err; > + > + priv = kzalloc(sizeof(*priv), GFP_KERNEL); > + if (!priv) > + return -ENOMEM; > + > + memcpy(&priv->entry, &cdev->cbmem_entry, sizeof(priv->entry)); > + > + priv->remap = memremap(priv->entry.address, > + priv->entry.entry_size, MEMREMAP_WB); > + if (!priv->remap) { > + err = -ENOMEM; > + goto failure; > + } > + > + err = sysfs_create_group(&dev->kobj, &cb_mem_attr_group); Ick, you just raced userspace and lost :( Please set the default group for the driver (dev_groups), so that the driver core will correctly create and remove this group without you having to do anything. thanks, greg k-h