Re: [PATCH v8] can: grcan: Add device driver for GRCAN and GRHCAN cores

2012-11-14 Thread Marc Kleine-Budde
On 11/14/2012 04:07 PM, Andreas Larsson wrote: > On 2012-11-14 12:22, Marc Kleine-Budde wrote: >> On 11/14/2012 12:02 PM, Andreas Larsson wrote: >>> On 2012-11-14 09:43, Marc Kleine-Budde wrote: Handle incoming events (rx or tx-complete) until: a) number of handled events == budget o

Re: [PATCH v8] can: grcan: Add device driver for GRCAN and GRHCAN cores

2012-11-14 Thread Andreas Larsson
On 2012-11-14 12:22, Marc Kleine-Budde wrote: On 11/14/2012 12:02 PM, Andreas Larsson wrote: On 2012-11-14 09:43, Marc Kleine-Budde wrote: Handle incoming events (rx or tx-complete) until: a) number of handled events == budget or b) no more events pending. while (work_done < budget && int

Re: [PATCH v8] can: grcan: Add device driver for GRCAN and GRHCAN cores

2012-11-14 Thread Marc Kleine-Budde
On 11/14/2012 12:02 PM, Andreas Larsson wrote: > On 2012-11-14 09:43, Marc Kleine-Budde wrote: >> Handle incoming events (rx or tx-complete) until: >> a) number of handled events == budget >> or >> b) no more events pending. >> >> while (work_done < budget && interrupts_pending()) { >>

Re: [PATCH v8] can: grcan: Add device driver for GRCAN and GRHCAN cores

2012-11-14 Thread Andreas Larsson
On 2012-11-14 09:43, Marc Kleine-Budde wrote: Handle incoming events (rx or tx-complete) until: a) number of handled events == budget or b) no more events pending. while (work_done < budget && interrupts_pending()) { work_done += handle_rx(budget - work_done);

Re: [PATCH v8] can: grcan: Add device driver for GRCAN and GRHCAN cores

2012-11-14 Thread Marc Kleine-Budde
On 11/14/2012 08:50 AM, Andreas Larsson wrote: > On 11/13/2012 10:15 PM, Marc Kleine-Budde wrote: > > [...] > >> On 11/12/2012 03:57 PM, Andreas Larsson wrote: >>> >+bpr = 0; /* Note bpr and brp are different concepts */ >>> >+rsj = bt->sjw; >>> >+ps1 = (bt->prop_seg + bt->phase_seg1)

Re: [PATCH v8] can: grcan: Add device driver for GRCAN and GRHCAN cores

2012-11-13 Thread Andreas Larsson
On 11/13/2012 10:15 PM, Marc Kleine-Budde wrote: [...] On 11/12/2012 03:57 PM, Andreas Larsson wrote: >+ bpr = 0; /* Note bpr and brp are different concepts */ >+ rsj = bt->sjw; >+ ps1 = (bt->prop_seg + bt->phase_seg1) - 1; /* tseg1 - 1 */ >+ ps2 = bt->phase_seg2; >+ scaler = (bt->br