All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-serial@vger.kernel.org, greg@kroah.com,
	the arch/x86 maintainers <x86@kernel.org>,
	feng.tang@intel.com
Subject: Re: [PATCH 2/5] hsu, earlyprintk: add early printk for hsu_port2 console
Date: Mon, 6 Sep 2010 15:15:42 +0100	[thread overview]
Message-ID: <20100906151542.2b155adf@linux.intel.com> (raw)
In-Reply-To: <20100906141746.GB29291@elte.hu>

> Please Cc: x86 patches to the x86 maintainers.

Sure - I should probably have also cc'd Feng - I've forwarded it and
added Feng so it doesn't get missed.

> > +static int hsu_inited;
> 
> 'initialized' is the proper English word i think.

Then we should probably run /sbin/initialize in future ;) inited is
perfectly fine computerspeak and much less typing.

> > +static void early_hsu_init(void)
> > +{
> > +	u8 lcr;
> > +
> > +	if (phsu && hsu_inited)
> > +		return;
> 
> Surely one of those will suffice as a "have we initialized" flag?
> 
> Also, under what circumstances can we call early_hsu_init() twice?

Don't think we can

> > +	/* GPIO workaround */
> > +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE,
> > MFD_GPIO_HSU_REG);
> > +	phsu = (void *)(__fix_to_virt(FIX_EARLYCON_MEM_BASE) +
> > +			(MFD_GPIO_HSU_REG & (PAGE_SIZE - 1)));
> > +
> > +	*((u32 *)phsu) = 0x55465;
> 
> What does 0x55465 stand for?

It's a firmware fixup. Its a magic value (even to most of us who work
here ;)). Feng - am I right in thinking we don't need that anyway with
the current firmware ?

> > +{
> > +	unsigned int timeout = 10000; /* 10ms*/
> > +	u8 status;
> > +
> > +	while (timeout--) {
> > +		status = readb(phsu + UART_LSR);
> > +		if (status & BOTH_EMPTY)
> > +			break;
> > +
> > +		udelay(1);
> > +	}
> > +
> > +	if (timeout == 0xffffffff)
> > +		return;
> 
> Using the -1 literal will dtrt too, and will be slightly clearer to
> the potentially overworked reader of such patches.

If they have a degree in C sign propagation. Better is probably 

	while (--timeout) {..
	}


  reply	other threads:[~2010-09-06 14:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06 12:39 [PATCH 1/5] mrst_earlyprintk: add a kmsg_dumper to dump the printk buffer when panic Alan Cox
2010-09-06 12:39 ` [PATCH 2/5] hsu, earlyprintk: add early printk for hsu_port2 console Alan Cox
2010-09-06 14:17   ` Ingo Molnar
2010-09-06 14:15     ` Alan Cox [this message]
2010-09-06 16:18       ` Ingo Molnar
2010-09-07  1:28       ` Feng Tang
2010-09-06 12:39 ` [PATCH 3/5] hsu, earlyprintk: remove the GPIO work around Alan Cox
2010-09-06 12:40 ` [PATCH 4/5] serial: mrst_max3110: some code cleanup Alan Cox
2010-09-06 12:40 ` [PATCH 5/5] mrst_max3110: Make the IRQ option runtime Alan Cox

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=20100906151542.2b155adf@linux.intel.com \
    --to=alan@linux.intel.com \
    --cc=feng.tang@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.