All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@linux.intel.com>
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 18:18:20 +0200	[thread overview]
Message-ID: <20100906161820.GA6241@elte.hu> (raw)
In-Reply-To: <20100906151542.2b155adf@linux.intel.com>


* Alan Cox <alan@linux.intel.com> wrote:

> > 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.

thx.

> > > +static int hsu_inited;
> > 
> > 'initialized' is the proper English word i think.
> 
> Then we should probably run /sbin/initialize in future ;) [...]

Fortunately there's no /sbin/inited.

> [...] inited is perfectly fine computerspeak and much less typing.

It's a distinctly annoying grammar mistake (to me at least) and it only 
comes up very rarely in the kernel - which has its fair share of 
annoying grammar otherwise.

As per a quick & dirty 'git grep' run we have 4267 (96%) instances of 
'initialized' and only 174 (4%) 'inited' instances usage right now.

hsu_init_done might be a compromise?

But ... no strong feelings in any case. If you the native speaker are 
not annoyed by reading 'inited' then i guess i'm in the minority.

> > > +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 ?

If it's some magic number it's worth symbolizing it - keeping future 
generations of happy mrst hackers from wondering at that incantation.

> 
> > > +{
> > > +	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.

My 8yo son knows it that the next number below zero is -1, and he 
distinctly has no degree in C sign propagation rules. But you are right 
to point out the correct solution:

> [...] Better is probably 
> 
> 	while (--timeout) {..
> 	}

indeed.

Thanks,

	Ingo

  reply	other threads:[~2010-09-06 16:18 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
2010-09-06 16:18       ` Ingo Molnar [this message]
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=20100906161820.GA6241@elte.hu \
    --to=mingo@elte.hu \
    --cc=alan@linux.intel.com \
    --cc=feng.tang@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-serial@vger.kernel.org \
    --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.