Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5295496ybv; Tue, 11 Feb 2020 12:57:31 -0800 (PST) X-Google-Smtp-Source: APXvYqy13IH940AkuqUXLDzkZ87GXqSVOUbCagYJF1ipSKJJSCv2SoqLyOXy21aK023Z7eKRmIRJ X-Received: by 2002:aca:ab52:: with SMTP id u79mr3871505oie.145.1581454651184; Tue, 11 Feb 2020 12:57:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581454651; cv=none; d=google.com; s=arc-20160816; b=OB6QeAuIqZBVzsa+K/U1jazbibPJJaV/l7F98ZegDxCx6ZtCGMoG7GlgrW0Kfowr1q fo/f7lvUR/OyRkiNX4HOpZ/qriIP61lVpHQ2vbLxXsoaNpBpYXj+sD92nRcrkb383PIe sT3/Df0B1qZ/SX6kOe8Lc2twlb+4Ri5d60h3dxoDqZfCxQQjqaEsgiE1RmyPEJqCpu70 zUYNMctFicLl0XaHl3ykFZPIWHrp5XbGXQGR1dcwJ6IQc3bvvhHQH3xt6XLEotRMtT2b +Tt+fwEbFqL8jKjoFNG4+A1XZucFAMe7eTK6QifR04lSy5AgxwTrRL9ttjKQ/lNgAyyX Lwzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=acIUjsDQAjyocitBZY+cN3ywb+k5hO0DSbLF5ve0MBk=; b=SvAc5CX93oB/NqP6kPv/arIuKOsdICSP/HPPnTOa4FxiB0l7U3/S8JFqJ8BFsBhJoZ zYOhlXMzIIpdyiepwpUX4nMbX8aDZn8yDJagUkTUhg2VxMMIuoktLNmcRqOKmPhpNU8c cMsu+D/WsIuF5nUJQihGzcPrqVuuw66NlLKU9reBcbl9efiTvt2IjoRRxgXRCc6uG7Rj 1P3kp+94fr05oN/Ehij7yDPlRoG8+VkZWjZfYpeSd9hjvdC3ZlJ2AVD7wkCo7l5hpJos V/daZOIP1fJDPfX4EUuCUPS8SObLzNNO7dB5mLE9nxEi4PaFf9idMuO3aOzwVOzS3kzi Ir3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U0OuxxUF; 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 200si2120845oii.156.2020.02.11.12.57.18; Tue, 11 Feb 2020 12:57:31 -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=U0OuxxUF; 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 S1729193AbgBKRSi (ORCPT + 99 others); Tue, 11 Feb 2020 12:18:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:44564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727954AbgBKRSi (ORCPT ); Tue, 11 Feb 2020 12:18:38 -0500 Received: from localhost (unknown [104.133.9.100]) (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 CAD6C20578; Tue, 11 Feb 2020 17:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581441516; bh=d+G1kH6PuPcpK/vgEAYZT5zRCug6wULTh1C5dFAkCLU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U0OuxxUFxc6JzUL0wcYRVH93AQWkx9gbK37pIl2pFQeyTPnK47wBJ1LzbK0AAKn5b av6brJaC00sXlP2/WYqD0I4N3sWA5Zlgj0rpnCUh0jI4aTCwJ34neI+vq/5O7RmewF EMBps2STPX+59ugI43bQZpPevaWONvznwzscfjW0= Date: Tue, 11 Feb 2020 09:18:36 -0800 From: Greg KH To: roman.sudarikov@linux.intel.com Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, bgregg@netflix.com, ak@linux.intel.com, kan.liang@linux.intel.com, alexander.antonov@intel.com Subject: Re: [PATCH v5 3/3] perf =?iso-8859-1?Q?x86?= =?iso-8859-1?Q?=3A_Exposing_an_Uncore_unit_to_PMON_for_Intel_Xeon?= =?iso-8859-1?Q?=AE?= server platform Message-ID: <20200211171836.GB1933705@kroah.com> References: <20200211161549.19828-1-roman.sudarikov@linux.intel.com> <20200211161549.19828-4-roman.sudarikov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211161549.19828-4-roman.sudarikov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 07:15:49PM +0300, roman.sudarikov@linux.intel.com wrote: > +static struct attribute *uncore_empry_attr; What is this for? > +static struct attribute_group skx_iio_mapping_group = { > + .attrs = &uncore_empry_attr, Again, what for? You just overwrite this value so why have it at all? > + .is_visible = skx_iio_mapping_visible, > +}; > + > +const static struct attribute_group *skx_iio_attr_update[] = { > + &skx_iio_mapping_group, > + NULL, > +}; > + > +static int skx_iio_set_mapping(struct intel_uncore_type *type) > +{ > + char buf[64]; > + int ret = 0; > + long die; > + struct attribute **attrs; > + struct dev_ext_attribute *eas; > + > + ret = skx_iio_get_topology(type); > + if (ret) > + return ret; > + > + // One more for NULL. > + attrs = kzalloc((uncore_max_dies() + 1) * sizeof(*attrs), GFP_KERNEL); > + if (!attrs) { > + kfree(type->topology); > + return -ENOMEM; > + } > + > + eas = kzalloc(sizeof(*eas) * uncore_max_dies(), GFP_KERNEL); > + if (!eas) { > + kfree(attrs); > + kfree(type->topology); > + return -ENOMEM; > + } > + for (die = 0; die < uncore_max_dies(); die++) { > + sprintf(buf, "node%ld", die); > + eas[die].attr.attr.name = kstrdup(buf, GFP_KERNEL); > + if (!eas[die].attr.attr.name) { > + ret = -ENOMEM; > + goto err; > + } > + eas[die].attr.attr.mode = 0444; > + eas[die].attr.show = skx_iio_mapping_show; > + eas[die].attr.store = NULL; > + eas[die].var = (void *)die; > + attrs[die] = &eas[die].attr.attr; You HAVE to call sysfs_attr_init() on any dynamically created attributes. I am guessing you never ran this code with lockdep enabled? {sigh} greg k-h