public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Domsch <Matt_Domsch@dell.com>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: linux-ia64@vger.kernel.org,
	Matt Tolentino <matthew.e.tolentino@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add some EFI device smarts
Date: Tue, 20 Apr 2004 23:50:38 +0000	[thread overview]
Message-ID: <20040420235038.GB29850@lists.us.dell.com> (raw)
In-Reply-To: <200404201600.26207.bjorn.helgaas@hp.com>

[-- Attachment #1: Type: text/plain, Size: 2121 bytes --]

On Tue, Apr 20, 2004 at 04:00:26PM -0600, Bjorn Helgaas wrote:
> (Like much of the EFI stuff, this really isn't ia64-specific.  Maybe
> it's time to move some of it under drivers/efi?  If there's interest,
> I can look at doing that.)

Matt T. had done the work to move it under drivers/efi, though now
that there's a drivers/firmware, that's more appropraite.  It also
converted it to use sysfs instead of proc.  There was a bug in
efivars_exit() where it was removing stuff (which could sleep) while
holding a spinlock which wasn't good, but that was about the only
issue anyone had with it.

> +		/* Convert Unicode to normal chars */
> +		for (i = 0; i < (name_size/sizeof(name_unicode[0])); i++)
> +			name_utf8[i] = name_unicode[i] & 0xff;
> +		name_utf8[i] = 0;

I've never had a clear understanding of this.  It's not really UTF8
(else straight ASCII text could be used), but more like UCS2.  (Yeah,
I'm sure I named it wrong myself too in the rest of the file...)  

> +
> +		if (strcmp(name_utf8, name))
> +			continue;

This ignores the fact that someone could create a variable with the
same name but a different vendor GUID, and it would return the first
one found.  Unfortunately, you need to request both pieces
specifically - 

+int
+efi_get_variable(char *name, efi_variable_t *guid, unsigned char *data, unsigned long *size)

and do a guidcmp() on them as well as the strcmp() on the name.

> +int __init
> +efi_uart_console_only(void)

So to be useful, efivars can't be build modular anymore, right?  Then
Kconfig needs to change as well.  It's module_init(), is that early
enough to be used?  Where is efi_uart_console_only() called from?
It's not in this patch.

> +typedef struct {
> +	u8 type;
> +	u8 sub_type;
> +	u16 length;
> +} efi_generic_dev_path_t;

No typedefs, just struct efi_generic_dev_path, and
__attribute__((packed)) please just to be safe.


Thanks,
Matt

-- 
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-04-20 23:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20 22:00 [PATCH] add some EFI device smarts Bjorn Helgaas
2004-04-20 23:50 ` Matt Domsch [this message]
2004-04-21 12:59   ` Bjorn Helgaas
2004-04-21 14:22     ` Matthew Wilcox
2004-04-21  7:05 ` Tolentino, Matthew E

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=20040420235038.GB29850@lists.us.dell.com \
    --to=matt_domsch@dell.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.e.tolentino@intel.com \
    /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