linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Ong, Boon Leong" <boon.leong.ong@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Peter Jones <pjones@redhat.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Roy Franz <roy.franz@linaro.org>, Borislav Petkov <bp@alien8.de>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	"Anvin, H Peter" <h.peter.anvin@intel.com>
Subject: Re: [PATCH v10 1/1] efi: a misc char interface for user to update efi firmware
Date: Thu, 28 Jan 2016 12:16:02 +0000	[thread overview]
Message-ID: <20160128121602.GD2571@codeblueprint.co.uk> (raw)
In-Reply-To: <F54AEECA5E2B9541821D670476DAE19C4A8ABF06@PGSMSX102.gar.corp.intel.com>

On Tue, 26 Jan, at 03:10:03AM, Kweh Hock Leong wrote:
> > 
> > This mutex is not needed. It doesn't protect anything in your code.
> 
> This is to synchronize/serializes one of the instant is calling efi_capsule_supported()
> and the other one is calling efi_capsule_update() which they are exported symbol
> from capsule.c.
 
You don't need to synchronise them.

Looking at my original capsule patches I can see why you might be
doing this locking, but it's unnecessary. You don't need to serialise
access to efi_capsule_supported() and efi_capsule_update().

Internally to the core EFI capsule code we need to ensure that we
don't allow capsules with conflicting reset types to be sent to the
firmware (how would we know the type of reset to perform?), but that
should be entirely transparent to your driver.  

I'm planning on re-sending my capsule patches, so all this should
become clearer.

> > This function would be much more simple if you handled the above
> > condition differently.
> > 
> > Instead of having code in efi_capsule_setup_info() to allocate the
> > initial ->pages memory, why not just allocate it in efi_capsule_open()
> > at the same time as you allocate the private_data? You can then
> > free it in efi_capsule_release() (you're leaking it at the moment).
> > 
> > You are always going to need at least one element in ->pages for
> > successful operation, so you might as well allocate it up front.
> 
> Just want to double check I understand you correctly. Do you mean
> I should free ->pages during close(2) but not free the ->pages[X] if
> there is any successfully submitted?

Yes, that's correct.

  reply	other threads:[~2016-01-28 12:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  3:10 [PATCH v10 1/1] efi: a misc char interface for user to update efi firmware Kweh, Hock Leong
2016-01-28 12:16 ` Matt Fleming [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-29  1:22 Kweh, Hock Leong
2016-01-26  3:09 Kweh, Hock Leong
2015-12-18 12:13 [PATCH v10 0/1] Enable capsule loader interface for efi firmware updating Kweh, Hock Leong
2015-12-18 12:13 ` [PATCH v10 1/1] efi: a misc char interface for user to update efi firmware Kweh, Hock Leong
2015-12-21 17:04   ` Bryan O'Donoghue
2015-12-21 17:37     ` Borislav Petkov
2015-12-21 17:45       ` Bryan O'Donoghue
2016-01-21 12:35     ` Matt Fleming
2016-01-21 11:51   ` Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160128121602.GD2571@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=boon.leong.ong@intel.com \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=h.peter.anvin@intel.com \
    --cc=hock.leong.kweh@intel.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=pjones@redhat.com \
    --cc=roy.franz@linaro.org \
    --cc=semen.protsenko@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).