From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v3 08/11] tpm: Introduce TPM_CHIP_FLAG_VIRTUAL Date: Mon, 22 Feb 2016 12:19:22 -0700 Message-ID: <20160222191922.GH22088@obsidianresearch.com> References: <1455885728-10315-1-git-send-email-stefanb@linux.vnet.ibm.com> <1455885728-10315-9-git-send-email-stefanb@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1455885728-10315-9-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Stefan Berger Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Fri, Feb 19, 2016 at 07:42:05AM -0500, Stefan Berger wrote: > cdev_init(&chip->cdev, &tpm_fops); > - chip->cdev.owner = dev->driver->owner; Shouldn't this be: chip->cdev.owner = THIS_MODULE; ? Please drop this hunk into the 'tpm: Get rid of module locking' patch > + > + if (!(chip->flags & TPM_CHIP_FLAG_VIRTUAL)) > + err = sysfs_create_group(&chip->dev.parent->kobj, > + &tpm_dev_group); > + else > + chip->groups[chip->groups_cnt++] = &tpm_dev_group; For other reviewers: The intent here is to make another patch that moves the main sysfs to only use groups with symlinks link ppi does now. Does sysfs work with vtpm? I am worried about dev_get_drvdata here (and other places): static ssize_t durations_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tpm_chip *chip = dev_get_drvdata(dev); There is only one dev_set_drvdata and it does not apply to chip->dev. Ultimately this should change to container_of like ppi does. Jason ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140