Re: [PATCH 3/3] max3100: adds console support for MAX3100

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 19, 2010 at 8:31 PM, Grant Likely <grant.likely@xxxxxxxxxxxx> wrote:

>> +config SERIAL_MAX3100_CONSOLE_N
>> +       int "Number of MAX3100 chips to wait before registering console"
>> +       depends on SERIAL_MAX3100_CONSOLE=y
>> +       default "1"
>> +       help
>> +         Unfortunately due to the async nature of Linux boot we must
>> +         know in advance when to register the console. If we do it
>> +         too early not all the MAX3100 chips are known to the system
>> +         yet. And we just cannot know how many MAX3100 will be in the
>> +         system so it's impossible to wait for the last one.  If you
>> +         just want to have the console on the first MAX3100 chip
>> +         probed (ttyMAX0) it's safe to leave this to 1.
>
> This seems wrong and fragile.  It certainly isn't multiplatform safe
> to have it as a CONFIG setting because every board will have a
> different number of devices that it needs to wait for.  I don't know
> the console code very well though, but it seems to me that there
> should be a way to register the console regardless and then be able to
> hold off output until the actual backing device shows up.
>
> Anybody know the right thing to do here?

I'll try to dig in the console code, any suggestion from others if
more than welcome.

>> +               else  {
>> +                       u16 tx, rx;
>
> inconsistent braces.  If you use {} on the else side, then please use
> {} on the if side too.

ack, strange checkpatch.pl didin't catch these.

>> +                                IRQF_TRIGGER_FALLING, "max3100", s) < 0) {
>
> try to avoid unrelated whitespace changes, it adds noise when reviewing.
>

ack

>> +               parity |= MAX3100_PARITY_ON;
>
> s->parity?
>

huh, well spotted. ack

>> +       } else {
>> +               tx &= ~MAX3100_PE;
>> +               parity &= ~MAX3100_PARITY_ON;
>> +       }
>> +
>> +       if (parity == 'o')
>> +               parity |= MAX3100_PARITY_ODD;
>> +       else
>> +               parity &= ~MAX3100_PARITY_ODD;
>
> ditto?

ack

>
>
> Also, these blocks are really verbose; maybe do this:

ack, I'll reorganize this chunk of code.

>
>> +
>> +       msleep(50);
>
> Why the sleep?  Shouldn't the console driver be able to handle the SPI
> device not being ready yet?

it's for the max3100 to settle. I'll double check the needed time and
add a comment.

>> +                       max3100_sr(max3100s[i], tx, &rx);
>> +               }
>
> Same comment on braces as for above.
>

ack

Thanks again for the review.

-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux