Netdev List
 help / color / mirror / Atom feed
* [PATCH 3/4] X25: remove bkl in inq and outq ioctls
From: Andrew Hendry @ 2010-11-18 23:21 UTC (permalink / raw)
  To: netdev


Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>

---
 net/x25/af_x25.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 2259783..2f235a6 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1361,12 +1361,10 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case TIOCOUTQ: {
 			int amount;
 
-			lock_kernel();
 			amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
 			if (amount < 0)
 				amount = 0;
 			rc = put_user(amount, (unsigned int __user *)argp);
-			unlock_kernel();
 			break;
 		}
 
@@ -1377,11 +1375,11 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			 * These two are safe on a single CPU system as
 			 * only user tasks fiddle here
 			 */
-			lock_kernel();
+			lock_sock(sk);
 			if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
 				amount = skb->len;
+			release_sock(sk);
 			rc = put_user(amount, (unsigned int __user *)argp);
-			unlock_kernel();
 			break;
 		}
 
-- 
1.7.1




^ permalink raw reply related

* [PATCH 4/4] X25: remove bkl in routing ioctls
From: Andrew Hendry @ 2010-11-18 23:21 UTC (permalink / raw)
  To: netdev


Routing doesn't use the socket data and is protected by x25_route_list_lock

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>

---
 net/x25/af_x25.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 2f235a6..2351ace 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1412,9 +1412,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			rc = -EPERM;
 			if (!capable(CAP_NET_ADMIN))
 				break;
-			lock_kernel();
 			rc = x25_route_ioctl(cmd, argp);
-			unlock_kernel();
 			break;
 		case SIOCX25GSUBSCRIP:
 			lock_kernel();
@@ -1710,9 +1708,7 @@ static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
 		rc = -EPERM;
 		if (!capable(CAP_NET_ADMIN))
 			break;
-		lock_kernel();
 		rc = x25_route_ioctl(cmd, argp);
-		unlock_kernel();
 		break;
 	case SIOCX25GSUBSCRIP:
 		lock_kernel();
-- 
1.7.1




^ permalink raw reply related

* 2.6.37-rc2-git4: Reported regressions from 2.6.36
From: Rafael J. Wysocki @ 2010-11-18 23:23 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Maciej Rutecki, Florian Mickler, Andrew Morton, Linus Torvalds,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI

This message contains a list of some regressions from 2.6.36,
for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.

If you know of any other unresolved regressions from 2.6.36, please let us
know either and we'll add them to the list.  Also, please let us know
if any of the entries below are invalid.

Each entry from the list will be sent additionally in an automatic reply
to this message with CCs to the people involved in reporting and handling
the issue.


Listed regressions statistics:

  Date          Total  Pending  Unresolved
  ----------------------------------------
  2010-11-19       39       29          25


Unresolved regressions
----------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23222
Subject		: 2.6.36 radeon KMS: [drm] Cannot find any crtc or sizes
Submitter	: Ján Bednár <jan.bednar@gmail.com>
Date		: 2010-11-18 15:33 (1 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23142
Subject		: autofs4 hang in 2.6.37-rc1
Submitter	: Avi Kivity <avi@redhat.com>
Date		: 2010-11-14 12:55 (5 days old)
Message-ID	: <4CDFDC2B.6040205@redhat.com>
References	: http://marc.info/?l=linux-kernel&m=128973936026185&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23122
Subject		: Regression in 2.6.37-rc1 for Intel 915 Graphics Adapter - bisected to commit e9e331a
Submitter	: Larry Finger <Larry.Finger@lwfinger.net>
Date		: 2010-11-11 1:47 (8 days old)
Message-ID	: <4CDB4B1D.7000503@lwfinger.net>
References	: http://marc.info/?l=linux-kernel&m=128944001311444&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23102
Subject		: [bisected] i915 regression in post 2.6.36 kernels
Submitter	: Johannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
Date		: 2010-11-10 7:02 (9 days old)
Message-ID	: <201011100802.20332.johannes.hirte@fem.tu-ilmenau.de>
References	: http://marc.info/?l=linux-kernel&m=128937310017057&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23092
Subject		: WARNING in tty_io.c
Submitter	: Shan Wei <shanwei@cn.fujitsu.com>
Date		: 2010-11-10 8:06 (9 days old)
Message-ID	: <4CDA5291.4010802@cn.fujitsu.com>
References	: http://marc.info/?l=linux-kernel&m=128937645120159&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23012
Subject		: ftdi_sio /dev/ttyUSB error:  "Resource Temporarily Unavailable"
Submitter	: Kevin Smith <thirdwiggin@gmail.com>
Date		: 2010-11-16 06:25 (3 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22942
Subject		: [2.6.37-rc1, OOM] virtblk: OOM in do_virtblk_request()
Submitter	: Dave Chinner <david@fromorbit.com>
Date		: 2010-11-05 1:30 (14 days old)
Message-ID	: <20101105013003.GE13830@dastard>
References	: http://marc.info/?l=linux-kernel&m=128892062917641&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22912
Subject		: spi_lm70llp module crash on unload (2.6.37-rc1)
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-05 0:16 (14 days old)
Message-ID	: <20101104171620.00d8c95d.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128891627913647&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22882
Subject		: (2.6.37-rc1) amd64-agp module crashed on second load
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-05 0:13 (14 days old)
Message-ID	: <20101104171333.fea1f498.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128891605213447&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22812
Subject		: kernel oops on 2.6.37-rc1
Submitter	: Andrew <atswartz@gmail.com>
Date		: 2010-11-12 16:05 (7 days old)
First-Bad-Commit: http://git.kernel.org/linus/a68c439b1966c91f0ef474e2bf275d6792312726


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22692
Subject		: [regression, 2.6.37-rc1] 'ip link tap0 up' stuck in do_exit()
Submitter	: Dave Chinner <david@fromorbit.com>
Date		: 2010-11-03 6:26 (16 days old)
Message-ID	: <20101103062609.GB31163@dastard>
References	: http://marc.info/?l=linux-kernel&m=128876560131870&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22682
Subject		: [oops, 2.6.37-rc1] Unpacking initramfs failed, oops in free_init_pages()
Submitter	: Dave Chinner <david@fromorbit.com>
Date		: 2010-11-03 1:54 (16 days old)
Message-ID	: <20101103015427.GA31163@dastard>
References	: http://marc.info/?l=linux-kernel&m=128874930119723&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22672
Subject		: Regression in 2.6.37-rc1 for Intel 945 Graphics Adapter - bisected to commit e9e331a
Submitter	: Larry Finger <Larry.Finger@lwfinger.net>
Date		: 2010-11-11 01:56 (8 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22652
Subject		: [drm:i915_gem_mmap_gtt_ioctl] *ERROR* Attempting to mmap a purgeable buffer
Submitter	: Tobias <devnull@plzk.org>
Date		: 2010-11-10 21:59 (9 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22642
Subject		: 2.6.37-rc1: Disk takes 10 seconds to resume - MacBook2,1
Submitter	: Tobias <devnull@plzk.org>
Date		: 2010-11-10 19:33 (9 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22572
Subject		: Linux 2.6.37-rc1 (acpi_video)
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-02 18:51 (17 days old)
Message-ID	: <20101102115106.bac57d21.randy.dunlap@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128872403920449&w=2
		  http://marc.info/?l=linux-acpi&m=128874714517914&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22562
Subject		: Regression in 2.6.37-rc1 - logs spammed with "unable to enumerate USB port" - bisected to commit 3df7169e
Submitter	: Larry Finger <Larry.Finger@lwfinger.net>
Date		: 2010-11-02 22:32 (17 days old)
First-Bad-Commit: http://git.kernel.org/linus/3df7169e73fc1d71a39cffeacc969f6840cdf52b
Message-ID	: <4CD09166.4060202@lwfinger.net>
References	: http://marc.info/?l=linux-kernel&m=128873713207906&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22552
Subject		: AMD boot freeze bisected to b126b4703afa4010b161784a43650337676dd03b
Submitter	: Borislav Petkov <bp@amd64.org>
Date		: 2010-11-02 17:03 (17 days old)
First-Bad-Commit: http://git.kernel.org/linus/b126b4703afa4010b161784a43650337676dd03b
Message-ID	: <20101102170335.GC24927@aftab>
References	: http://marc.info/?l=linux-kernel&m=128871752109913&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22542
Subject		: [2.6.37-rc1] drm:i195 errors
Submitter	: Paul Rolland <rol@witbe.net>
Date		: 2010-11-02 14:58 (17 days old)
Message-ID	: <20101102155813.09cb2c6e@tux.DEF.witbe.net>
References	: http://marc.info/?l=linux-kernel&m=128870991628970&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22532
Subject		: 2.6.37-rc1: BUG: scheduling while atomic (kvm_init)
Submitter	: Thomas Meyer <thomas@m3y3r.de>
Date		: 2010-11-02 19:06 (17 days old)
Message-ID	: <50AA24C585B14210A44AB599605C7CBD@hugo>
References	: http://marc.info/?l=linux-kernel&m=128872479921559&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22522
Subject		: 2.6.37-rc1 boot Problem - BUG: unable to handle kernel null pointer - dmesg und config Datei
Submitter	: werner <w.landgraf@ru.ru>
Date		: 2010-11-02 2:09 (17 days old)
Message-ID	: <web-395697375@zbackend1.aha.ru>
References	: http://marc.info/?l=linux-kernel&m=128866380110940&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22472
Subject		: vga_switcheroo fails to switch from intel to ati
Submitter	: Radu Andries <admiral0@tuxfamily.org>
Date		: 2010-11-08 16:46 (11 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22282
Subject		: 2.6.37-rc1: WARNING..debugobjects: ODEBUG: free active (active state 0) object type: percpu_counter
Submitter	: Randy Dunlap <randy.dunlap@oracle.com>
Date		: 2010-11-01 21:58 (18 days old)
Message-ID	: <4CCF37E8.1070208@oracle.com>
References	: http://marc.info/?l=linux-kernel&m=128864879328429&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22102
Subject		: [2.6.36-09452-g2d10d87] BUG: unable to handle kernel NULL pointer dereference at (null)
Submitter	: Carlos R. Mafra <crmafra2@gmail.com>
Date		: 2010-10-30 20:07 (20 days old)
Message-ID	: <20101030200751.GA2866@Pilar.aei.mpg.de>
References	: http://marc.info/?l=linux-kernel&m=128846935825136&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22082
Subject		: 2.6.36-git11 -- kernel/pid.c:419 invoked rcu_dereference_check() without protection!
Submitter	: Miles Lane <miles.lane@gmail.com>
Date		: 2010-10-29 5:22 (21 days old)
Message-ID	: <AANLkTimGgzOZb8EwUQO16cZcL+ycveKTYzg_AAX+D+Kw@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128832975924288&w=2


Regressions with patches
------------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22962
Subject		: building (e)glibc against 2.6.37-rc1 headers fails
Submitter	:  <stephan@openelec.tv>
Date		: 2010-11-15 00:09 (4 days old)
Patch		: https://bugzilla.kernel.org/show_bug.cgi?id=22962#c5


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22932
Subject		: [REGRESSION] [2.6.37-rc1] Fan noise after suspend to ram/disk
Submitter	: Maciej Rutecki <maciej.rutecki@gmail.com>
Date		: 2010-11-04 16:06 (15 days old)
First-Bad-Commit: http://git.kernel.org/linus/3e384ee6c687cb397581ee8f9440fc8220cfac80
Message-ID	: <201011041706.59046.maciej.rutecki@gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128888684308982&w=2
Handled-By	: Rafael J. Wysocki <rjw@sisk.pl>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=37372


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22722
Subject		: regression since 2.6.36: backlight in sony-laptop not working
Submitter	: Norbert Preining <preining@logic.at>
Date		: 2010-11-04 14:29 (15 days old)
Message-ID	: <20101104142915.GC7650@gamma.logic.tuwien.ac.at>
References	: http://marc.info/?l=linux-kernel&m=128888097600601&w=2
Handled-By	: Mattia Dongili <malattia@linux.it>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=37442


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22662
Subject		: divide error in select_task_rq_fair()
Submitter	: Myron Stowe <myron.stowe@hp.com>
Date		: 2010-11-10 23:58 (9 days old)
Patch		: http://lkml.org/lkml/2010/11/13/176


For details, please visit the bug entries and follow the links given in
references.

As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions from 2.6.36,
unresolved as well as resolved, at:

http://bugzilla.kernel.org/show_bug.cgi?id=21782

Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.

Thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [RFC PATCH] netfilter: remove the duplicate tables
From: Changli Gao @ 2010-11-18 23:36 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Patrick McHardy, David S. Miller, netfilter-devel, netdev
In-Reply-To: <1290095020.2781.203.camel@edumazet-laptop>

On Thu, Nov 18, 2010 at 11:43 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le jeudi 18 novembre 2010 à 22:39 +0800, Changli Gao a écrit :
>> As only xt_counters are private to each CPU, we don't need to maintain
>> a whole individual table for each CPU.
>>
>> In the kernel space, we use the memory of ipt_entry.counters to save a
>> pointer to a percpu xt_counters. When iptables runs, it only update the
>> counters on its own CPU.
>>
>> On non SMP platforms, no change is made.
>>
>> Only the code of iptables is converted. Thanks for reviews.
>>
>
> Changli
>
> I answered you a (difficult) work was in progress, still you post a
> patch that needs our review and time ? This is crazy.

Sorry for interrupt, and thanks for review. I posted this patch to
check if I was in the right direction.

>
> I am tempted to stop here. Oh well...
>
> Your way of allocating a percpu counter for each counter is a pure TLB
> and cache line blower (up to two cache lines per counter), not counting
> the time needed to load a new table with 10.000 entries. Some people
> still use scripts with hundred of calls to iptables.
>
> percpu_alloc() is not meant to be used thousand of times per second. It
> is not scalable.
>
> You consume 16 bytes per counter in the main table, while 4 bytes index
> should be enough on SMP build. Most firewalls I know use two or four
> cpus at most.

I think we can't change the structure of ipt_entry, as it is exposed
to userspace as an ABI. Though there is no need to keep the same
structure in the kernel space, converting is a big work. :)

>
> They care about speed, not really because iptables duplicates table on
> each cpu. By the way, not using NUMA can definitly hurt firewalls with
> many rules, unless you make sure the main table is vmalloced() with node
> distribution, not a single node. Even with this, this can hurt
> latencies.

This is what I worry about. I think only test can verify it.

>
> Allocating one contiguous percpu var for all counters is a must.
>
> Problem is : percpu alloc doesnt allow big allocations.
>
> #define PCPU_MIN_UNIT_SIZE      PFN_ALIGN(32 << 10)
>
> So max allocation is 32 Kbytes, thats 2048 'xt_counters' only.
> -> cannot really use pcpu-alloc, but a kmalloc_node() or vmalloc_node()
> per cpu
>

Thanks. I'll try.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* Re: error while building the kernel Mainline
From: Justin P. Mattock @ 2010-11-18 23:48 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: David Miller, randy.dunlap, eric.dumazet, linux-net, linux-kernel,
	netdev, horms, netfilter-devel
In-Reply-To: <4CE59F3F.3080407@trash.net>

On 11/18/2010 01:48 PM, Patrick McHardy wrote:
> Am 18.11.2010 22:15, schrieb David Miller:
>> From: David Miller<davem@davemloft.net>
>> Date: Thu, 18 Nov 2010 13:10:04 -0800 (PST)
>>
>>> From: Randy Dunlap<randy.dunlap@oracle.com>
>>> Date: Thu, 18 Nov 2010 13:03:18 -0800
>>>
>>>> On Thu, 18 Nov 2010 12:54:51 -0800 (PST) David Miller wrote:
>>>>
>>>>> From: Patrick McHardy<kaber@trash.net>
>>>>> Date: Thu, 18 Nov 2010 21:32:11 +0100
>>>>>
>>>>>> Thanks for testing. Dave, please apply directly, thanks!
>>>>
>>>> Dave,
>>>>
>>>> This patch does not fix the config/build error that I posted for linux-next.
>>>
>>> And it has bugs, now when NF_CONNTRACT is set to "m" IPVS isn't offered
>>> at all.
>>>
>>> So I'm reverting.
>>
>> Ignore this, I was looking for "*_IPVS" in the config instead of
>> "*_IP_VS" for some stupid reason.
>
> I always make the same mistake :)
>
>> Patch is sane and I'll look into Randy's problem when I get a chance.
>> :-)
>
> I've already asked the tproxy guys to look into this, it's a
> different problem that requires more tproxy knowledge than
> have.
>


go outside to clean the garage, and put up the christmas lights up, come 
back and am freaking for a second that the problems not fixed...

tripping me out man!!

Justin P. Mattock

^ permalink raw reply

* Re: [PATCH 1/2] of/phylib: Use device tree properties to initialize Marvell PHYs.
From: David Daney @ 2010-11-18 23:48 UTC (permalink / raw)
  To: Grant Likely
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Cyril Chemparathy,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Arnaud Patard
In-Reply-To: <20101118204036.GA16908-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>

On 11/18/2010 12:40 PM, Grant Likely wrote:
> On Wed, Nov 17, 2010 at 03:54:30PM -0800, David Daney wrote:
>> Some aspects of PHY initialization are board dependent, things like
>> indicator LED connections and some clocking modes cannot be determined
>> by probing.  The dev_flags element of struct phy_device can be used to
>> control these things if an appropriate value can be passed from the
>> Ethernet driver.  We run into problems however if the PHY connections
>> are specified by the device tree.  There is no way for the Ethernet
>> driver to know what flags it should pass.
>>
>> If we are using the device tree, the struct phy_device will be
>> populated with the device tree node corresponding to the PHY, and we
>> can extract extra configuration information from there.
>>
>> The next question is what should the format of that information be?
>> It is highly device specific, and the device tree representation
>> should not be tied to any arbitrary kernel defined constants.  A
>> straight forward representation is just to specify the exact bits that
>> should be set using the "marvell,reg-init" property:
>>
>>        phy5: ethernet-phy@5 {
>> 	reg =<5>;
>> 	device_type = "ethernet-phy";
>
> Some notes:
> - device_type is only relevant for real openfirmware platforms.  It
>    should not appear in dts files.

Documentation/powerpc/dts-bindings/phy.txt says device_type should be 
here.  I can remove it from my patch comment, but should it also be 
removed from the phy.txt file?

> - This example phy node needs a compatible property

Ok, what would you suggest?  Something like:

      compatible = "marvell,88e1145";

I can certainly do that, but I would note that the kernel probes these 
things and would completely ignore the compatible property.

> - This new binding needs to be documented.  You can use devicetree.org.
>

Agreed, I was planning to do that once the patch was approved.

Where would that go?  Vendor:Marvell, or Type:PHY/compatible=marvell,* 
... or somewhere else?

>> 	marvell,reg-init =
>> 		<0x00030010 0x5777>, /* Reg 3,16<- 0x5777 */
>> 		<0x00030011 0x00aa>, /* Reg 3,17<- 0x00aa */
>> 		<0x00030012 0x4105>, /* Reg 3,18<- 0x4105 */
>> 		<0x00030013 0x0060>; /* Reg 3,19<- 0x0060 */
>> 		<0x00020015 0x00300000>; /* clear bits 4..5 of Reg 2,21 */
>>        };
>>


Thanks,
David Daney

^ permalink raw reply

* 2.6.37-rc2-git4: Reported regressions 2.6.35 -> 2.6.36
From: Rafael J. Wysocki @ 2010-11-18 23:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Maciej Rutecki, Florian Mickler, Andrew Morton, Linus Torvalds,
	Kernel Testers List, Network Development, Linux ACPI,
	Linux PM List, Linux SCSI List, Linux Wireless List, DRI

This message contains a list of some post-2.6.35 regressions introduced before
2.6.36, for which there are no fixes in the mainline known to the tracking team.
If any of them have been fixed already, please let us know.

If you know of any other unresolved post-2.6.35 regressions, please let us know
either and we'll add them to the list.  Also, please let us know if any
of the entries below are invalid.

Each entry from the list will be sent additionally in an automatic reply to
this message with CCs to the people involved in reporting and handling the
issue.


Listed regressions statistics:

  Date          Total  Pending  Unresolved
  ----------------------------------------
  2010-11-19       92       38          34
  2010-10-17       70       27          27
  2010-10-10       56       16          15
  2010-10-03       52       16          14
  2010-09-26       46       15          13
  2010-09-20       38       15          15
  2010-09-12       28       14          13
  2010-08-30       21       16          15


Unresolved regressions
----------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23212
Subject		: multifunction card reader of acer aspire one stopped working
Submitter	: Thibault Mondary <thibm@free.fr>
Date		: 2010-11-18 14:03 (1 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23132
Subject		: without "pci=nocrs", Dell Inspiron 1545 hangs
Submitter	: Bjorn Helgaas <bjorn.helgaas@hp.com>
Date		: 2010-11-17 19:18 (2 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=23062
Subject		: kvm segfaults on 2.6.36-64bit kernel with 32 bit userspace
Submitter	: Jorge Boncompte <jorge@dti2.net>
Date		: 2010-11-17 11:59 (2 days old)
First-Bad-Commit: http://git.kernel.org/linus/9581d442b905


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22842
Subject		: iwl3945 suddenly stops working
Submitter	: Felipe Contreras <felipe.contreras@gmail.com>
Date		: 2010-11-14 11:14 (5 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22782
Subject		: 2.6.36: general protection fault during lockfs lockspace removal
Submitter	: nik@linuxbox.cz <nik@linuxbox.cz>
Date		: 2010-11-12 12:05 (7 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22732
Subject		: 2.6.37-rc1: hibernation breaks swap
Submitter	: Zhang Rui <rui.zhang@intel.com>
Date		: 2010-11-11 08:38 (8 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22272
Subject		: High [extra timer interrupt] count in powertop since 2.6.36
Submitter	: Ian Kumlien <pomac@demius.net>
Date		: 2010-10-30 23:52 (20 days old)
Message-ID	: <alpine.LNX.2.00.1010310148450.24290@twilight.pomac.com>
References	: http://marc.info/?l=linux-kernel&m=128848330304431&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22172
Subject		: alsa-util.c: snd_pcm_avail_delay() returned strange values: delay 0 is less than avail 32
Submitter	: Tobias <devnull@plzk.org>
Date		: 2010-11-06 09:33 (13 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22092
Subject		: Kernel v2.6.36 trouble on USB disconnect
Submitter	: Ketil Froyn <ketil@froyn.name>
Date		: 2010-10-29 8:05 (21 days old)
Message-ID	: <AANLkTik5qVxkEGVAA1PSOGk2KTW+ekHpSwttsQEWzWj+@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128833956503607&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21932
Subject		: Regression in 2.6.36 in single stepping over hardware breakpoint (Wine)
Submitter	: Michael Stefaniuc <mstefani@redhat.com>
Date		: 2010-10-28 0:12 (22 days old)
Message-ID	: <4CC8BFDD.8080600@redhat.com>
References	: http://marc.info/?l=linux-kernel&m=128822477714448&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21662
Subject		: 2.6.35->2.6.36 regression, vanilla kernel panic, ppp or hrtimers crashing
Submitter	: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Date		: 2010-10-25 9:22 (25 days old)
Message-ID	: <201010251222.37191.nuclearcat@nuclearcat.com>
References	: http://marc.info/?l=linux-kernel&m=128799855826011&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21652
Subject		: several problems with intel graphics since 2.6.36
Submitter	: Norbert Preining <preining@logic.at>
Date		: 2010-10-27 14:32 (23 days old)
Message-ID	: <20101027143252.GA8676@gamma.logic.tuwien.ac.at>
References	: http://marc.info/?l=linux-kernel&m=128818998630241&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21402
Subject		: [KVM] Noacpi Windows guest can not boot up on 32bit KVM host
Submitter	: xudong <xudong.hao@intel.com>
Date		: 2010-10-29 03:01 (21 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21372
Subject		: NULL pointer deference at disk_replace_part_tbl+0x32
Submitter	: Luis R. Rodriguez <mcgrof@gmail.com>
Date		: 2010-10-28 17:22 (22 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21332
Subject		: Regression in single stepping over hardware breakpoint (Wine)
Submitter	: Michael Stefaniuc <mstefani@redhat.com>
Date		: 2010-10-27 23:41 (23 days old)
First-Bad-Commit: http://git.kernel.org/linus/0c4519e825c9e2b6a8310deff8582f8c35bfbba9


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20462
Subject		: 2.6.36-rc7-git2 - panic/GPF: e1000e/vlans?
Submitter	: Nikola Ciprich <extmaillist@linuxbox.cz>
Date		: 2010-10-15 7:10 (35 days old)
Message-ID	: <20101015071008.GA8714@pcnci.linuxbox.cz>
References	: http://marc.info/?l=linux-kernel&m=128712984831303&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20352
Subject		: Fwd: Re: UML kernel crash of v2.6.36-rcX kernel
Submitter	: Toralf Förster <toralf.foerster@gmx.de>
Date		: 2010-10-13 11:28 (37 days old)
First-Bad-Commit: http://git.kernel.org/linus/365b18189789bfa1acd9939e6312b8a4b4577b28
Message-ID	: <201010131328.06465.toralf.foerster@gmx.de>
References	: http://marc.info/?l=linux-kernel&m=128696930132503&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20342
Subject		: [LogFS] [2.6.36-rc7] Deadlock in logfs_get_wblocks, hold and wait on same lock super->s_write_mutex
Submitter	: Prasad Joshi <prasadjoshi124@gmail.com>
Date		: 2010-10-13 9:49 (37 days old)
Message-ID	: <AANLkTinvsMxTxEbDEFmb5M-6fYjdRvErU==Zs7+qANkV@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128696335024718&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20332
Subject		: [LogFS] [2.6.36-rc7] Kernel BUG at lib/btree.c:465!
Submitter	: Prasad Joshi <prasadjoshi124@gmail.com>
Date		: 2010-10-12 18:56 (38 days old)
Message-ID	: <AANLkTimAbCZNhLQ5nADUiAC+7JpAeJBEmjFwdxyZ-FxO@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128690910501830&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20322
Subject		: 2.6.36-rc7: inconsistent lock state: inconsistent {IN-RECLAIM_FS-R} -> {RECLAIM_FS-ON-W} usage.
Submitter	: Dave Jones <davej@redhat.com>
Date		: 2010-10-11 20:10 (39 days old)
Message-ID	: <20101011201007.GA29707@redhat.com>
References	: http://marc.info/?l=linux-kernel&m=128682782828453&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20232
Subject		: kworker consumes ~100% CPU on HP Elitebook 8540w running 2.6.36_rc6-git4
Submitter	: Ozan Caglayan <ozan@pardus.org.tr>
Date		: 2010-10-13 06:13 (37 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20172
Subject		: 2.6.36-rc7 boot stalls unless nolapic_timer - Lenovo S12
Submitter	: Chris Vine <chris@cvine.freeserve.co.uk>
Date		: 2010-10-10 12:59 (40 days old)
Message-ID	: <<20101010135912.76eb61b7@boulder.homenet>>
References	: http://marc.info/?l=linux-kernel&m=128671620721712&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19802
Subject		: [drm:init_ring_common] *ERROR* render ring head not reset to zero
Submitter	: Thomas Meyer <thomas@m3y3r.de>
Date		: 2010-10-04 20:31 (46 days old)
Message-ID	: <201010042231.20320.thomas@m3y3r.de>
References	: http://marc.info/?l=linux-kernel&m=128622441331199&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19782
Subject		: 2.6.36-rc6-git2 -- BUG dentry: Poison overwritten (after resume from hibernation)
Submitter	: Miles Lane <miles.lane@gmail.com>
Date		: 2010-10-03 3:54 (47 days old)
Message-ID	: <AANLkTimrqtzBHAZSuDhEs_3CKA6pCbM35b1BtKH=MvC_@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128607809314079&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19632
Subject		: 2.6.36-rc6: modprobe Not tainted warning
Submitter	: Heinz Diehl <htd@fritha.org>
Date		: 2010-09-30 18:25 (50 days old)
Message-ID	: <20100930182516.GA15089@fritha.org>
References	: http://marc.info/?l=linux-kernel&m=128587114004680&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19392
Subject		: WARNING: at drivers/net/wireless/ath/ath5k/base.c:3475 ath5k_bss_info_changed+0x44/0x168 [ath5k]()
Submitter	: Justin Mattock <justinmattock@gmail.com>
Date		: 2010-09-28 22:30 (52 days old)
Message-ID	: <AANLkTim5WCGKPvEkOkO_YnMF9pg8mvLfQoFBNUFpfa_k@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128571307018635&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19372
Subject		: 2.6.36-rc6: WARNING: at drivers/gpu/drm/radeon/radeon_fence.c:235 radeon_fence_wait+0x35a/0x3c0
Submitter	: Alexey Dobriyan <adobriyan@gmail.com>
Date		: 2010-09-29 21:29 (51 days old)
Message-ID	: <20100929212923.GA5578@core2.telecom.by>
References	: http://marc.info/?l=linux-kernel&m=128579579400315&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19142
Subject		: Screen flickers when switching from the console to X
Submitter	: Andrey Rahmatullin <wrar@altlinux.org>
Date		: 2010-09-27 12:05 (53 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19052
Subject		: 2.6.36-rc5-git1 -- [drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
Submitter	: Miles Lane <miles.lane@gmail.com>
Date		: 2010-09-22 23:47 (58 days old)
Message-ID	: <AANLkTikWQjUQjFJU9MO1+XbSLAEE-GARz+S+Dz2Fgu4h@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128519926626322&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=19002
Subject		: Radeon rv730 AGP/KMS/DRM kernel lockup
Submitter	: Duncan <1i5t5.duncan@cox.net>
Date		: 2010-09-23 16:48 (57 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=17121
Subject		: Two blank rectangles more than 10 cm long when booting
Submitter	: Eric Valette <eric.valette@free.fr>
Date		: 2010-08-26 17:24 (85 days old)


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=17061
Subject		: 2.6.36-rc1 on zaurus: bluetooth regression
Submitter	: Pavel Machek <pavel@ucw.cz>
Date		: 2010-08-21 15:24 (90 days old)
Message-ID	: <20100821152445.GA1536@ucw.cz>
References	: http://marc.info/?l=linux-kernel&m=128240433828087&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=16971
Subject		: qla4xxx compile failure on 32-bit PowerPC: missing readq and writeq
Submitter	: Meelis Roos <mroos@linux.ee>
Date		: 2010-08-19 21:03 (92 days old)
Message-ID	: <<alpine.SOC.1.00.1008192359310.19654@math.ut.ee>>
References	: http://marc.info/?l=linux-kernel&m=128225184900892&w=2


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=16951
Subject		: hackbench regression with 2.6.36-rc1
Submitter	: Zhang, Yanmin <yanmin_zhang@linux.intel.com>
Date		: 2010-08-18 6:18 (93 days old)
Message-ID	: <1282112318.21202.8.camel@ymzhang.sh.intel.com>
References	: http://marc.info/?l=linux-kernel&m=128211235904910&w=2


Regressions with patches
------------------------

Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=22452
Subject		: data corruption after mmap()ing a file and writev() some data to another file
Submitter	: Marius Tolzmann <tolzmann@molgen.mpg.de>
Date		: 2010-11-08 10:33 (11 days old)
Patch		: http://www.spinics.net/lists/xfs/msg02126.html


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21092
Subject		: Kernel 2.6.36 Bug during quotaon on reiserfs
Submitter	:  <markus.gapp@gmx.net>
Date		: 2010-10-24 16:57 (26 days old)
Handled-By	: Jan Kara <jack@suse.cz>
Patch		: https://bugzilla.kernel.org/attachment.cgi?id=35292


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20182
Subject		: 2.6.36-rc7: NULL pointer dereference in ehci_clear_tt_buffer_complete
Submitter	: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date		: 2010-10-11 20:56 (39 days old)
Message-ID	: <tkrat.9f585ea47331a2a2@s5r6.in-berlin.de>
References	: http://marc.info/?l=linux-kernel&m=128683064431749&w=2
Handled-By	: Alan Stern <stern@rowland.harvard.edu>
Patch		: https://patchwork.kernel.org/patch/250761/


Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=20162
Subject		: [LogFS][2.6.36.rc7+] Kernel BUG at readwrite.c:1193
Submitter	: Prasad Joshi <prasadjoshi124@gmail.com>
Date		: 2010-10-10 17:44 (40 days old)
Message-ID	: <AANLkTi=JkcuWBPo+X-i+9o-BJFVqjea1J3e=Mr=HvAWF@mail.gmail.com>
References	: http://marc.info/?l=linux-kernel&m=128673196203340&w=2
Handled-By	:  Prasad Gajanan Joshi <prasadjoshi124@gmail.com>
Patch		: https://bugzilla.kernel.org/show_bug.cgi?id=20162#c1


For details, please visit the bug entries and follow the links given in
references.

As you can see, there is a Bugzilla entry for each of the listed regressions.
There also is a Bugzilla entry used for tracking the regressions introduced
between 2.6.35 and 2.6.36, unresolved as well as resolved, at:

http://bugzilla.kernel.org/show_bug.cgi?id=16444

Please let the tracking team know if there are any Bugzilla entries that
should be added to the list in there.

Thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 0/15] RFC: create drivers/net/legacy for ISA, EISA, MCA drivers
From: Joe Perches @ 2010-11-18 23:52 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Paul Gortmaker, davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <AANLkTim2yH7eAqqYQW+JVC5GtFR5mX4uZnMa02+yubFk@mail.gmail.com>

On Thu, 2010-11-04 at 19:28 -0700, Jeff Kirsher wrote:
> Joe and I are working to organize the drivers into
> /drivers/net/<technology> directories and to cleanup the Kconfig to
> reflect the organization.  Ethernet drivers will be in
> /drivers/net/ethernet, and so on.
[]
> We are hoping not to drag this out and plan on getting this into
> 2.6.38 (net-next) within the couple of weeks.

What is an appropriate time frame for doing these
reorganization file/directory moves for net-next?

David, do you have a preference?


^ permalink raw reply

* Re: 2.6.37-rc2-git4: Reported regressions from 2.6.36
From: Alex Deucher @ 2010-11-18 23:52 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux Kernel Mailing List, Linux SCSI List, Linux ACPI,
	Network Development, Linux Wireless List, DRI, Florian Mickler,
	Andrew Morton, Kernel Testers List, Linus Torvalds, Linux PM List,
	Maciej Rutecki
In-Reply-To: <sKkKYVppECN.A.KhC.Phb5MB@chimera>

On Thu, Nov 18, 2010 at 6:23 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> This message contains a list of some regressions from 2.6.36,
> for which there are no fixes in the mainline known to the tracking team.
> If any of them have been fixed already, please let us know.
>
> If you know of any other unresolved regressions from 2.6.36, please let us
> know either and we'll add them to the list.  Also, please let us know
> if any of the entries below are invalid.
>
> Each entry from the list will be sent additionally in an automatic reply
> to this message with CCs to the people involved in reporting and handling
> the issue.
>
>
> Listed regressions statistics:
>
>  Date          Total  Pending  Unresolved
>  ----------------------------------------
>  2010-11-19       39       29          25
>
>
> Unresolved regressions
> ----------------------
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=23222
> Subject         : 2.6.36 radeon KMS: [drm] Cannot find any crtc or sizes
> Submitter       : Ján Bednár <jan.bednar@gmail.com>
> Date            : 2010-11-18 15:33 (1 days old)
>

I've added a fix to that bug.

Alex

>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=23142
> Subject         : autofs4 hang in 2.6.37-rc1
> Submitter       : Avi Kivity <avi@redhat.com>
> Date            : 2010-11-14 12:55 (5 days old)
> Message-ID      : <4CDFDC2B.6040205@redhat.com>
> References      : http://marc.info/?l=linux-kernel&m=128973936026185&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=23122
> Subject         : Regression in 2.6.37-rc1 for Intel 915 Graphics Adapter - bisected to commit e9e331a
> Submitter       : Larry Finger <Larry.Finger@lwfinger.net>
> Date            : 2010-11-11 1:47 (8 days old)
> Message-ID      : <4CDB4B1D.7000503@lwfinger.net>
> References      : http://marc.info/?l=linux-kernel&m=128944001311444&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=23102
> Subject         : [bisected] i915 regression in post 2.6.36 kernels
> Submitter       : Johannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
> Date            : 2010-11-10 7:02 (9 days old)
> Message-ID      : <201011100802.20332.johannes.hirte@fem.tu-ilmenau.de>
> References      : http://marc.info/?l=linux-kernel&m=128937310017057&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=23092
> Subject         : WARNING in tty_io.c
> Submitter       : Shan Wei <shanwei@cn.fujitsu.com>
> Date            : 2010-11-10 8:06 (9 days old)
> Message-ID      : <4CDA5291.4010802@cn.fujitsu.com>
> References      : http://marc.info/?l=linux-kernel&m=128937645120159&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=23012
> Subject         : ftdi_sio /dev/ttyUSB error:  "Resource Temporarily Unavailable"
> Submitter       : Kevin Smith <thirdwiggin@gmail.com>
> Date            : 2010-11-16 06:25 (3 days old)
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22942
> Subject         : [2.6.37-rc1, OOM] virtblk: OOM in do_virtblk_request()
> Submitter       : Dave Chinner <david@fromorbit.com>
> Date            : 2010-11-05 1:30 (14 days old)
> Message-ID      : <20101105013003.GE13830@dastard>
> References      : http://marc.info/?l=linux-kernel&m=128892062917641&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22912
> Subject         : spi_lm70llp module crash on unload (2.6.37-rc1)
> Submitter       : Randy Dunlap <randy.dunlap@oracle.com>
> Date            : 2010-11-05 0:16 (14 days old)
> Message-ID      : <20101104171620.00d8c95d.randy.dunlap@oracle.com>
> References      : http://marc.info/?l=linux-kernel&m=128891627913647&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22882
> Subject         : (2.6.37-rc1) amd64-agp module crashed on second load
> Submitter       : Randy Dunlap <randy.dunlap@oracle.com>
> Date            : 2010-11-05 0:13 (14 days old)
> Message-ID      : <20101104171333.fea1f498.randy.dunlap@oracle.com>
> References      : http://marc.info/?l=linux-kernel&m=128891605213447&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22812
> Subject         : kernel oops on 2.6.37-rc1
> Submitter       : Andrew <atswartz@gmail.com>
> Date            : 2010-11-12 16:05 (7 days old)
> First-Bad-Commit: http://git.kernel.org/linus/a68c439b1966c91f0ef474e2bf275d6792312726
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22692
> Subject         : [regression, 2.6.37-rc1] 'ip link tap0 up' stuck in do_exit()
> Submitter       : Dave Chinner <david@fromorbit.com>
> Date            : 2010-11-03 6:26 (16 days old)
> Message-ID      : <20101103062609.GB31163@dastard>
> References      : http://marc.info/?l=linux-kernel&m=128876560131870&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22682
> Subject         : [oops, 2.6.37-rc1] Unpacking initramfs failed, oops in free_init_pages()
> Submitter       : Dave Chinner <david@fromorbit.com>
> Date            : 2010-11-03 1:54 (16 days old)
> Message-ID      : <20101103015427.GA31163@dastard>
> References      : http://marc.info/?l=linux-kernel&m=128874930119723&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22672
> Subject         : Regression in 2.6.37-rc1 for Intel 945 Graphics Adapter - bisected to commit e9e331a
> Submitter       : Larry Finger <Larry.Finger@lwfinger.net>
> Date            : 2010-11-11 01:56 (8 days old)
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22652
> Subject         : [drm:i915_gem_mmap_gtt_ioctl] *ERROR* Attempting to mmap a purgeable buffer
> Submitter       : Tobias <devnull@plzk.org>
> Date            : 2010-11-10 21:59 (9 days old)
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22642
> Subject         : 2.6.37-rc1: Disk takes 10 seconds to resume - MacBook2,1
> Submitter       : Tobias <devnull@plzk.org>
> Date            : 2010-11-10 19:33 (9 days old)
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22572
> Subject         : Linux 2.6.37-rc1 (acpi_video)
> Submitter       : Randy Dunlap <randy.dunlap@oracle.com>
> Date            : 2010-11-02 18:51 (17 days old)
> Message-ID      : <20101102115106.bac57d21.randy.dunlap@oracle.com>
> References      : http://marc.info/?l=linux-kernel&m=128872403920449&w=2
>                  http://marc.info/?l=linux-acpi&m=128874714517914&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22562
> Subject         : Regression in 2.6.37-rc1 - logs spammed with "unable to enumerate USB port" - bisected to commit 3df7169e
> Submitter       : Larry Finger <Larry.Finger@lwfinger.net>
> Date            : 2010-11-02 22:32 (17 days old)
> First-Bad-Commit: http://git.kernel.org/linus/3df7169e73fc1d71a39cffeacc969f6840cdf52b
> Message-ID      : <4CD09166.4060202@lwfinger.net>
> References      : http://marc.info/?l=linux-kernel&m=128873713207906&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22552
> Subject         : AMD boot freeze bisected to b126b4703afa4010b161784a43650337676dd03b
> Submitter       : Borislav Petkov <bp@amd64.org>
> Date            : 2010-11-02 17:03 (17 days old)
> First-Bad-Commit: http://git.kernel.org/linus/b126b4703afa4010b161784a43650337676dd03b
> Message-ID      : <20101102170335.GC24927@aftab>
> References      : http://marc.info/?l=linux-kernel&m=128871752109913&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22542
> Subject         : [2.6.37-rc1] drm:i195 errors
> Submitter       : Paul Rolland <rol@witbe.net>
> Date            : 2010-11-02 14:58 (17 days old)
> Message-ID      : <20101102155813.09cb2c6e@tux.DEF.witbe.net>
> References      : http://marc.info/?l=linux-kernel&m=128870991628970&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22532
> Subject         : 2.6.37-rc1: BUG: scheduling while atomic (kvm_init)
> Submitter       : Thomas Meyer <thomas@m3y3r.de>
> Date            : 2010-11-02 19:06 (17 days old)
> Message-ID      : <50AA24C585B14210A44AB599605C7CBD@hugo>
> References      : http://marc.info/?l=linux-kernel&m=128872479921559&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22522
> Subject         : 2.6.37-rc1 boot Problem - BUG: unable to handle kernel null pointer - dmesg und config Datei
> Submitter       : werner <w.landgraf@ru.ru>
> Date            : 2010-11-02 2:09 (17 days old)
> Message-ID      : <web-395697375@zbackend1.aha.ru>
> References      : http://marc.info/?l=linux-kernel&m=128866380110940&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22472
> Subject         : vga_switcheroo fails to switch from intel to ati
> Submitter       : Radu Andries <admiral0@tuxfamily.org>
> Date            : 2010-11-08 16:46 (11 days old)
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22282
> Subject         : 2.6.37-rc1: WARNING..debugobjects: ODEBUG: free active (active state 0) object type: percpu_counter
> Submitter       : Randy Dunlap <randy.dunlap@oracle.com>
> Date            : 2010-11-01 21:58 (18 days old)
> Message-ID      : <4CCF37E8.1070208@oracle.com>
> References      : http://marc.info/?l=linux-kernel&m=128864879328429&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22102
> Subject         : [2.6.36-09452-g2d10d87] BUG: unable to handle kernel NULL pointer dereference at (null)
> Submitter       : Carlos R. Mafra <crmafra2@gmail.com>
> Date            : 2010-10-30 20:07 (20 days old)
> Message-ID      : <20101030200751.GA2866@Pilar.aei.mpg.de>
> References      : http://marc.info/?l=linux-kernel&m=128846935825136&w=2
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22082
> Subject         : 2.6.36-git11 -- kernel/pid.c:419 invoked rcu_dereference_check() without protection!
> Submitter       : Miles Lane <miles.lane@gmail.com>
> Date            : 2010-10-29 5:22 (21 days old)
> Message-ID      : <AANLkTimGgzOZb8EwUQO16cZcL+ycveKTYzg_AAX+D+Kw@mail.gmail.com>
> References      : http://marc.info/?l=linux-kernel&m=128832975924288&w=2
>
>
> Regressions with patches
> ------------------------
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22962
> Subject         : building (e)glibc against 2.6.37-rc1 headers fails
> Submitter       :  <stephan@openelec.tv>
> Date            : 2010-11-15 00:09 (4 days old)
> Patch           : https://bugzilla.kernel.org/show_bug.cgi?id=22962#c5
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22932
> Subject         : [REGRESSION] [2.6.37-rc1] Fan noise after suspend to ram/disk
> Submitter       : Maciej Rutecki <maciej.rutecki@gmail.com>
> Date            : 2010-11-04 16:06 (15 days old)
> First-Bad-Commit: http://git.kernel.org/linus/3e384ee6c687cb397581ee8f9440fc8220cfac80
> Message-ID      : <201011041706.59046.maciej.rutecki@gmail.com>
> References      : http://marc.info/?l=linux-kernel&m=128888684308982&w=2
> Handled-By      : Rafael J. Wysocki <rjw@sisk.pl>
> Patch           : https://bugzilla.kernel.org/attachment.cgi?id=37372
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22722
> Subject         : regression since 2.6.36: backlight in sony-laptop not working
> Submitter       : Norbert Preining <preining@logic.at>
> Date            : 2010-11-04 14:29 (15 days old)
> Message-ID      : <20101104142915.GC7650@gamma.logic.tuwien.ac.at>
> References      : http://marc.info/?l=linux-kernel&m=128888097600601&w=2
> Handled-By      : Mattia Dongili <malattia@linux.it>
> Patch           : https://bugzilla.kernel.org/attachment.cgi?id=37442
>
>
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=22662
> Subject         : divide error in select_task_rq_fair()
> Submitter       : Myron Stowe <myron.stowe@hp.com>
> Date            : 2010-11-10 23:58 (9 days old)
> Patch           : http://lkml.org/lkml/2010/11/13/176
>
>
> For details, please visit the bug entries and follow the links given in
> references.
>
> As you can see, there is a Bugzilla entry for each of the listed regressions.
> There also is a Bugzilla entry used for tracking the regressions from 2.6.36,
> unresolved as well as resolved, at:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=21782
>
> Please let the tracking team know if there are any Bugzilla entries that
> should be added to the list in there.
>
> Thanks!
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

^ permalink raw reply

* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2010-11-19  0:17 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: linux-next, linux-kernel, Thomas Graf

Hi all,

Today's linux-next merge of the net tree got a conflict in
net/ipv6/addrconf.c between commit
18a31e1e282f9ed563b131526a88162ccbe04ee3 ("ipv6: Expose reachable and
retrans timer values as msecs") from the net-current tree and commit
b382b191ea9e9ccefc437433d23befe91f4a8925 ("ipv6: AF_INET6 link address
family") from the net tree.

I fixed it up (I think - see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc net/ipv6/addrconf.c
index 2fc35b3,470e7ac..0000000
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@@ -3896,6 -3894,69 +3899,68 @@@ static void snmp6_fill_stats(u64 *stats
  	}
  }
  
+ static int inet6_fill_ifla6_attrs(struct sk_buff *skb, struct inet6_dev *idev)
+ {
+ 	struct nlattr *nla;
+ 	struct ifla_cacheinfo ci;
+ 
+ 	NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags);
+ 
+ 	ci.max_reasm_len = IPV6_MAXPLEN;
 -	ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100
 -		    + TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ);
 -	ci.reachable_time = idev->nd_parms->reachable_time;
 -	ci.retrans_time = idev->nd_parms->retrans_time;
++	ci.tstamp = cstamp_delta(idev->tstamp);
++	ci.reachable_time = jiffies_to_msecs(idev->nd_parms->reachable_time);
++	ci.retrans_time = jiffies_to_msecs(idev->nd_parms->retrans_time);
+ 	NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci);
+ 
+ 	nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32));
+ 	if (nla == NULL)
+ 		goto nla_put_failure;
+ 	ipv6_store_devconf(&idev->cnf, nla_data(nla), nla_len(nla));
+ 
+ 	/* XXX - MC not implemented */
+ 
+ 	nla = nla_reserve(skb, IFLA_INET6_STATS, IPSTATS_MIB_MAX * sizeof(u64));
+ 	if (nla == NULL)
+ 		goto nla_put_failure;
+ 	snmp6_fill_stats(nla_data(nla), idev, IFLA_INET6_STATS, nla_len(nla));
+ 
+ 	nla = nla_reserve(skb, IFLA_INET6_ICMP6STATS, ICMP6_MIB_MAX * sizeof(u64));
+ 	if (nla == NULL)
+ 		goto nla_put_failure;
+ 	snmp6_fill_stats(nla_data(nla), idev, IFLA_INET6_ICMP6STATS, nla_len(nla));
+ 
+ 	return 0;
+ 
+ nla_put_failure:
+ 	return -EMSGSIZE;
+ }
+ 
+ static size_t inet6_get_link_af_size(const struct net_device *dev)
+ {
+ 	if (!__in6_dev_get(dev))
+ 		return 0;
+ 
+ 	return inet6_ifla6_size();
+ }
+ 
+ static int inet6_fill_link_af(struct sk_buff *skb, const struct net_device *dev)
+ {
+ 	struct inet6_dev *idev = __in6_dev_get(dev);
+ 
+ 	if (!idev)
+ 		return -ENODATA;
+ 
+ 	if (inet6_fill_ifla6_attrs(skb, idev) < 0)
+ 		return -EMSGSIZE;
+ 
+ 	return 0;
+ }
+ 
+ static int inet6_parse_link_af(struct net_device *dev, const struct nlattr *nla)
+ {
+ 	return -EOPNOTSUPP;
+ }
+ 
  static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
  			     u32 pid, u32 seq, int event, unsigned int flags)
  {

^ permalink raw reply

* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2010-11-19  0:17 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: linux-next, linux-kernel, Eric Dumazet

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

Hi all,

Today's linux-next merge of the net tree got a conflict in
drivers/net/bonding/bond_main.c between commit
3006bc38895895f1a0352c2e17e1a503f35f7e2f ("bonding: fix a race in IGMP
handling") from the net-current tree and commit
866f3b25a2eb60d7529c227a0ecd80c3aba443fd ("bonding: IGMP handling
cleanup") from the net tree.

I just assumed that the latter is a better solution and used that.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

^ permalink raw reply

* Re: error while building the kernel Mainline
From: Simon Horman @ 2010-11-19  0:20 UTC (permalink / raw)
  To: Justin P. Mattock
  Cc: Patrick McHardy, David Miller, randy.dunlap, eric.dumazet,
	linux-net, linux-kernel, netdev, netfilter-devel
In-Reply-To: <4CE5BB30.5080209@gmail.com>

On Thu, Nov 18, 2010 at 03:48:00PM -0800, Justin P. Mattock wrote:
> On 11/18/2010 01:48 PM, Patrick McHardy wrote:
> >Am 18.11.2010 22:15, schrieb David Miller:
> >>From: David Miller<davem@davemloft.net>
> >>Date: Thu, 18 Nov 2010 13:10:04 -0800 (PST)
> >>
> >>>From: Randy Dunlap<randy.dunlap@oracle.com>
> >>>Date: Thu, 18 Nov 2010 13:03:18 -0800
> >>>
> >>>>On Thu, 18 Nov 2010 12:54:51 -0800 (PST) David Miller wrote:
> >>>>
> >>>>>From: Patrick McHardy<kaber@trash.net>
> >>>>>Date: Thu, 18 Nov 2010 21:32:11 +0100
> >>>>>
> >>>>>>Thanks for testing. Dave, please apply directly, thanks!
> >>>>
> >>>>Dave,
> >>>>
> >>>>This patch does not fix the config/build error that I posted for linux-next.
> >>>
> >>>And it has bugs, now when NF_CONNTRACT is set to "m" IPVS isn't offered
> >>>at all.
> >>>
> >>>So I'm reverting.
> >>
> >>Ignore this, I was looking for "*_IPVS" in the config instead of
> >>"*_IP_VS" for some stupid reason.
> >
> >I always make the same mistake :)
> >
> >>Patch is sane and I'll look into Randy's problem when I get a chance.
> >>:-)
> >
> >I've already asked the tproxy guys to look into this, it's a
> >different problem that requires more tproxy knowledge than
> >have.
> >
> 
> 
> go outside to clean the garage, and put up the christmas lights up,
> come back and am freaking for a second that the problems not
> fixed...
> 
> tripping me out man!!

On a similar note, sorry for not participating in the IPVS portion of
this thread, it was all over by the time that I woke up this morning.

^ permalink raw reply

* [PATCH] SuperH IrDA: correct Baud rate error correction
From: Nicolas Kaiser @ 2010-11-19  0:24 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Kuninori Morimoto, irda-users, netdev, linux-kernel

It looks to me as if the second value of rate_err_array is intended
to be a decimal 625. However, with a leading 0 it becomes an octal
constant, and as such evaluates to a decimal 405.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
 drivers/net/irda/sh_sir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
index 00b38bc..52a7c86 100644
--- a/drivers/net/irda/sh_sir.c
+++ b/drivers/net/irda/sh_sir.c
@@ -258,7 +258,7 @@ static int sh_sir_set_baudrate(struct sh_sir_self *self, u32 baudrate)
 
 	/* Baud Rate Error Correction x 10000 */
 	u32 rate_err_array[] = {
-		0000, 0625, 1250, 1875,
+		   0,  625, 1250, 1875,
 		2500, 3125, 3750, 4375,
 		5000, 5625, 6250, 6875,
 		7500, 8125, 8750, 9375,
-- 
1.7.2.2

^ permalink raw reply related

* Re: [PATCH 0/15] RFC: create drivers/net/legacy for ISA, EISA, MCA drivers
From: Jeff Kirsher @ 2010-11-19  0:34 UTC (permalink / raw)
  To: Joe Perches; +Cc: Paul Gortmaker, davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <1290124345.1817.53.camel@Joe-Laptop>

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

On Thu, 2010-11-18 at 15:52 -0800, Joe Perches wrote:
> On Thu, 2010-11-04 at 19:28 -0700, Jeff Kirsher wrote:
> > Joe and I are working to organize the drivers into
> > /drivers/net/<technology> directories and to cleanup the Kconfig to
> > reflect the organization.  Ethernet drivers will be in
> > /drivers/net/ethernet, and so on.
> []
> > We are hoping not to drag this out and plan on getting this into
> > 2.6.38 (net-next) within the couple of weeks.
> 
> What is an appropriate time frame for doing these
> reorganization file/directory moves for net-next?
> 
> David, do you have a preference?
> 

I am almost ~50% done with the patch, I am hoping to get the patch out
this weekend.  I have been testing as I go to ensure that there are no
breakages,that has been the reason for the delay.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: 2.6.37-rc2-git4: Reported regressions 2.6.35 -> 2.6.36
From: Jesse Gross @ 2010-11-19  0:36 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux Kernel Mailing List, Maciej Rutecki, Florian Mickler,
	Andrew Morton, Linus Torvalds, Kernel Testers List,
	Network Development, Linux ACPI, Linux PM List, Linux SCSI List,
	Linux Wireless List, DRI
In-Reply-To: <tTUH_XeInOH.A.dMF.c3b5MB@chimera>

On Thu, Nov 18, 2010 at 3:50 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=20462
> Subject         : 2.6.36-rc7-git2 - panic/GPF: e1000e/vlans?
> Submitter       : Nikola Ciprich <extmaillist@linuxbox.cz>
> Date            : 2010-10-15 7:10 (35 days old)
> Message-ID      : <20101015071008.GA8714@pcnci.linuxbox.cz>
> References      : http://marc.info/?l=linux-kernel&m=128712984831303&w=2

A fix for this has been sent to -stable:
http://www.spinics.net/lists/netdev/msg146227.html

^ permalink raw reply

* Re: [PATCH 1/2] of/phylib: Use device tree properties to initialize Marvell PHYs.
From: Grant Likely @ 2010-11-19  0:39 UTC (permalink / raw)
  To: David Daney
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Cyril Chemparathy,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Arnaud Patard
In-Reply-To: <4CE5BB56.4040605-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>

On Thu, Nov 18, 2010 at 03:48:38PM -0800, David Daney wrote:
> On 11/18/2010 12:40 PM, Grant Likely wrote:
> >On Wed, Nov 17, 2010 at 03:54:30PM -0800, David Daney wrote:
> >>Some aspects of PHY initialization are board dependent, things like
> >>indicator LED connections and some clocking modes cannot be determined
> >>by probing.  The dev_flags element of struct phy_device can be used to
> >>control these things if an appropriate value can be passed from the
> >>Ethernet driver.  We run into problems however if the PHY connections
> >>are specified by the device tree.  There is no way for the Ethernet
> >>driver to know what flags it should pass.
> >>
> >>If we are using the device tree, the struct phy_device will be
> >>populated with the device tree node corresponding to the PHY, and we
> >>can extract extra configuration information from there.
> >>
> >>The next question is what should the format of that information be?
> >>It is highly device specific, and the device tree representation
> >>should not be tied to any arbitrary kernel defined constants.  A
> >>straight forward representation is just to specify the exact bits that
> >>should be set using the "marvell,reg-init" property:
> >>
> >>       phy5: ethernet-phy@5 {
> >>	reg =<5>;
> >>	device_type = "ethernet-phy";
> >
> >Some notes:
> >- device_type is only relevant for real openfirmware platforms.  It
> >   should not appear in dts files.
> 
> Documentation/powerpc/dts-bindings/phy.txt says device_type should
> be here.  I can remove it from my patch comment, but should it also
> be removed from the phy.txt file?

Heh, I didn't realize it was there.  Yes, it should be removed from
the phy.txt file.  It is clearly wrong.

> 
> >- This example phy node needs a compatible property
> 
> Ok, what would you suggest?  Something like:
> 
>      compatible = "marvell,88e1145";

Yes.

> 
> I can certainly do that, but I would note that the kernel probes
> these things and would completely ignore the compatible property.

That's okay.

> 
> >- This new binding needs to be documented.  You can use devicetree.org.
> >
> 
> Agreed, I was planning to do that once the patch was approved.
> 
> Where would that go?  Vendor:Marvell, or
> Type:PHY/compatible=marvell,* ... or somewhere else?

The page name should be compatible=marvell,88e1145, and it should be
have the vendor and type tags added so it appears in the category
pages.

g.

^ permalink raw reply

* Re: [PATCH] SuperH IrDA: correct Baud rate error correction
From: Stephen Hemminger @ 2010-11-19  0:41 UTC (permalink / raw)
  To: Nicolas Kaiser
  Cc: Samuel Ortiz, Kuninori Morimoto, irda-users, netdev, linux-kernel
In-Reply-To: <20101119012402.43e9aa61@absol.kitzblitz>

On Fri, 19 Nov 2010 01:24:02 +0100
Nicolas Kaiser <nikai@nikai.net> wrote:

>  	u32 rate_err_array[] = {
> -		0000, 0625, 1250, 1875,
> +		   0,  625, 1250, 1875,
>  		2500, 3125, 3750, 4375,
>  		5000, 5625, 6250, 6875,
>  		7500, 8125, 8750, 9375,

While you are at it make that table const.

^ permalink raw reply

* Re: 2.6.37-rc2-git4: Reported regressions 2.6.35 -> 2.6.36
From: Mark Lord @ 2010-11-19  0:47 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux Kernel Mailing List, Maciej Rutecki, Florian Mickler,
	Andrew Morton, Linus Torvalds, Kernel Testers List,
	Network Development, Linux ACPI, Linux PM List, Linux SCSI List,
	Linux Wireless List, DRI
In-Reply-To: <tTUH_XeInOH.A.dMF.c3b5MB@chimera>

On 10-11-18 06:50 PM, Rafael J. Wysocki wrote:
> This message contains a list of some post-2.6.35 regressions introduced before
> 2.6.36, for which there are no fixes in the mainline known to the tracking team.
> If any of them have been fixed already, please let us know.
>
> If you know of any other unresolved post-2.6.35 regressions, please let us know
> either and we'll add them to the list.  Also, please let us know if any
> of the entries below are invalid.

> Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=21652
> Subject		: several problems with intel graphics since 2.6.36
> Submitter	: Norbert Preining<preining-DX+603jRYB8@public.gmane.org>
> Date		: 2010-10-27 14:32 (23 days old)
> Message-ID	:<20101027143252.GA8676-DqSSrKF0TaySnEC3TeqHn5dqbFPxfnh/@public.gmane.org>
> References	: http://marc.info/?l=linux-kernel&m=128818998630241&w=2

That one is interesting to me.. I suspect it may be the same cause
as for https://bugzilla.kernel.org/show_bug.cgi?id=21952

I have one of those Samsung (N210) Netbooks here: works fine with 2.6.34 and 
earlier,
but fails to come out of suspend on 2.6.35/2.6.36 (haven't tried 2.6.37).

So perhaps add 21952 to the list, or link it to the 21652
(kind of amusing how similar the bug numbers are..).


My non-Intel graphics notebook (has ATI X1400 graphics) also has a resume
regression with 2.6.36.  But it does work fine with 2.6.35 (and earlier,
back many years).  As a result, I'm stuck with 2.6.35 for the time being,
and lack the time for a concerted debug effort on 2.6.36+ right now.

Cheers

^ permalink raw reply

* Re: [PATCH] SuperH IrDA: correct Baud rate error correction
From: Joe Perches @ 2010-11-19  1:05 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Nicolas Kaiser, Samuel Ortiz, Kuninori Morimoto, irda-users,
	netdev, linux-kernel
In-Reply-To: <20101118164150.22aa7e16@nehalam>

On Thu, 2010-11-18 at 16:41 -0800, Stephen Hemminger wrote:
> On Fri, 19 Nov 2010 01:24:02 +0100
> Nicolas Kaiser <nikai@nikai.net> wrote:
> >  	u32 rate_err_array[] = {
> > -		0000, 0625, 1250, 1875,
> > +		   0,  625, 1250, 1875,
> >  		2500, 3125, 3750, 4375,
> >  		5000, 5625, 6250, 6875,
> >  		7500, 8125, 8750, 9375,
> While you are at it make that table const.

Good find Nicolas.

static const might be better still.



^ permalink raw reply

* [PATCH] net: reduce the lines of code
From: Changli Gao @ 2010-11-19  2:04 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Changli Gao

Use macros to reduce the regularity lines.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 net/core/filter.c     |   96 +++-----------------------------------------------
 net/core/filter_def.h |   55 ++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 90 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 15a545d..2a8841d 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -39,51 +39,9 @@
 #include <linux/filter.h>
 
 enum {
-	BPF_S_RET_K = 0,
-	BPF_S_RET_A,
-	BPF_S_ALU_ADD_K,
-	BPF_S_ALU_ADD_X,
-	BPF_S_ALU_SUB_K,
-	BPF_S_ALU_SUB_X,
-	BPF_S_ALU_MUL_K,
-	BPF_S_ALU_MUL_X,
-	BPF_S_ALU_DIV_X,
-	BPF_S_ALU_AND_K,
-	BPF_S_ALU_AND_X,
-	BPF_S_ALU_OR_K,
-	BPF_S_ALU_OR_X,
-	BPF_S_ALU_LSH_K,
-	BPF_S_ALU_LSH_X,
-	BPF_S_ALU_RSH_K,
-	BPF_S_ALU_RSH_X,
-	BPF_S_ALU_NEG,
-	BPF_S_LD_W_ABS,
-	BPF_S_LD_H_ABS,
-	BPF_S_LD_B_ABS,
-	BPF_S_LD_W_LEN,
-	BPF_S_LD_W_IND,
-	BPF_S_LD_H_IND,
-	BPF_S_LD_B_IND,
-	BPF_S_LD_IMM,
-	BPF_S_LDX_W_LEN,
-	BPF_S_LDX_B_MSH,
-	BPF_S_LDX_IMM,
-	BPF_S_MISC_TAX,
-	BPF_S_MISC_TXA,
-	BPF_S_ALU_DIV_K,
-	BPF_S_LD_MEM,
-	BPF_S_LDX_MEM,
-	BPF_S_ST,
-	BPF_S_STX,
-	BPF_S_JMP_JA,
-	BPF_S_JMP_JEQ_K,
-	BPF_S_JMP_JEQ_X,
-	BPF_S_JMP_JGE_K,
-	BPF_S_JMP_JGE_X,
-	BPF_S_JMP_JGT_K,
-	BPF_S_JMP_JGT_X,
-	BPF_S_JMP_JSET_K,
-	BPF_S_JMP_JSET_X,
+#define BPF_DEFINE(user, kernel) kernel
+#include "filter_def.h"
+#undef BPF_DEFINE
 };
 
 /* No hurry in this branch */
@@ -436,51 +394,9 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
 	 * Invalid instructions are initialized to 0.
 	 */
 	static const u8 codes[] = {
-		[BPF_ALU|BPF_ADD|BPF_K]  = BPF_S_ALU_ADD_K + 1,
-		[BPF_ALU|BPF_ADD|BPF_X]  = BPF_S_ALU_ADD_X + 1,
-		[BPF_ALU|BPF_SUB|BPF_K]  = BPF_S_ALU_SUB_K + 1,
-		[BPF_ALU|BPF_SUB|BPF_X]  = BPF_S_ALU_SUB_X + 1,
-		[BPF_ALU|BPF_MUL|BPF_K]  = BPF_S_ALU_MUL_K + 1,
-		[BPF_ALU|BPF_MUL|BPF_X]  = BPF_S_ALU_MUL_X + 1,
-		[BPF_ALU|BPF_DIV|BPF_X]  = BPF_S_ALU_DIV_X + 1,
-		[BPF_ALU|BPF_AND|BPF_K]  = BPF_S_ALU_AND_K + 1,
-		[BPF_ALU|BPF_AND|BPF_X]  = BPF_S_ALU_AND_X + 1,
-		[BPF_ALU|BPF_OR|BPF_K]   = BPF_S_ALU_OR_K + 1,
-		[BPF_ALU|BPF_OR|BPF_X]   = BPF_S_ALU_OR_X + 1,
-		[BPF_ALU|BPF_LSH|BPF_K]  = BPF_S_ALU_LSH_K + 1,
-		[BPF_ALU|BPF_LSH|BPF_X]  = BPF_S_ALU_LSH_X + 1,
-		[BPF_ALU|BPF_RSH|BPF_K]  = BPF_S_ALU_RSH_K + 1,
-		[BPF_ALU|BPF_RSH|BPF_X]  = BPF_S_ALU_RSH_X + 1,
-		[BPF_ALU|BPF_NEG]        = BPF_S_ALU_NEG + 1,
-		[BPF_LD|BPF_W|BPF_ABS]   = BPF_S_LD_W_ABS + 1,
-		[BPF_LD|BPF_H|BPF_ABS]   = BPF_S_LD_H_ABS + 1,
-		[BPF_LD|BPF_B|BPF_ABS]   = BPF_S_LD_B_ABS + 1,
-		[BPF_LD|BPF_W|BPF_LEN]   = BPF_S_LD_W_LEN + 1,
-		[BPF_LD|BPF_W|BPF_IND]   = BPF_S_LD_W_IND + 1,
-		[BPF_LD|BPF_H|BPF_IND]   = BPF_S_LD_H_IND + 1,
-		[BPF_LD|BPF_B|BPF_IND]   = BPF_S_LD_B_IND + 1,
-		[BPF_LD|BPF_IMM]         = BPF_S_LD_IMM + 1,
-		[BPF_LDX|BPF_W|BPF_LEN]  = BPF_S_LDX_W_LEN + 1,
-		[BPF_LDX|BPF_B|BPF_MSH]  = BPF_S_LDX_B_MSH + 1,
-		[BPF_LDX|BPF_IMM]        = BPF_S_LDX_IMM + 1,
-		[BPF_MISC|BPF_TAX]       = BPF_S_MISC_TAX + 1,
-		[BPF_MISC|BPF_TXA]       = BPF_S_MISC_TXA + 1,
-		[BPF_RET|BPF_K]          = BPF_S_RET_K + 1,
-		[BPF_RET|BPF_A]          = BPF_S_RET_A + 1,
-		[BPF_ALU|BPF_DIV|BPF_K]  = BPF_S_ALU_DIV_K + 1,
-		[BPF_LD|BPF_MEM]         = BPF_S_LD_MEM + 1,
-		[BPF_LDX|BPF_MEM]        = BPF_S_LDX_MEM + 1,
-		[BPF_ST]                 = BPF_S_ST + 1,
-		[BPF_STX]                = BPF_S_STX + 1,
-		[BPF_JMP|BPF_JA]         = BPF_S_JMP_JA + 1,
-		[BPF_JMP|BPF_JEQ|BPF_K]  = BPF_S_JMP_JEQ_K + 1,
-		[BPF_JMP|BPF_JEQ|BPF_X]  = BPF_S_JMP_JEQ_X + 1,
-		[BPF_JMP|BPF_JGE|BPF_K]  = BPF_S_JMP_JGE_K + 1,
-		[BPF_JMP|BPF_JGE|BPF_X]  = BPF_S_JMP_JGE_X + 1,
-		[BPF_JMP|BPF_JGT|BPF_K]  = BPF_S_JMP_JGT_K + 1,
-		[BPF_JMP|BPF_JGT|BPF_X]  = BPF_S_JMP_JGT_X + 1,
-		[BPF_JMP|BPF_JSET|BPF_K] = BPF_S_JMP_JSET_K + 1,
-		[BPF_JMP|BPF_JSET|BPF_X] = BPF_S_JMP_JSET_X + 1,
+#define BPF_DEFINE(user, kernel) [user] = kernel + 1
+#include "filter_def.h"
+#undef BPF_DEFINE
 	};
 	int pc;
 
diff --git a/net/core/filter_def.h b/net/core/filter_def.h
new file mode 100644
index 0000000..51bd662
--- /dev/null
+++ b/net/core/filter_def.h
@@ -0,0 +1,55 @@
+#define BPF_A1(arg1) BPF_DEFINE(BPF_##arg1, BPF_S_##arg1)
+#define BPF_A2(arg1, arg2) \
+	BPF_DEFINE(BPF_##arg1|BPF_##arg2, BPF_S_##arg1##_##arg2)
+#define BPF_A3(arg1, arg2, arg3) \
+	BPF_DEFINE(BPF_##arg1|BPF_##arg2|BPF_##arg3, \
+		   BPF_S_##arg1##_##arg2##_##arg3)
+
+BPF_A2(RET, K),
+BPF_A2(RET, A),
+BPF_A3(ALU, ADD, K),
+BPF_A3(ALU, ADD, X),
+BPF_A3(ALU, SUB, K),
+BPF_A3(ALU, SUB, X),
+BPF_A3(ALU, MUL, K),
+BPF_A3(ALU, MUL, X),
+BPF_A3(ALU, DIV, X),
+BPF_A3(ALU, AND, K),
+BPF_A3(ALU, AND, X),
+BPF_A3(ALU, OR, K),
+BPF_A3(ALU, OR, X),
+BPF_A3(ALU, LSH, K),
+BPF_A3(ALU, LSH, X),
+BPF_A3(ALU, RSH, K),
+BPF_A3(ALU, RSH, X),
+BPF_A2(ALU, NEG),
+BPF_A3(LD, W, ABS),
+BPF_A3(LD, H, ABS),
+BPF_A3(LD, B, ABS),
+BPF_A3(LD, W, LEN),
+BPF_A3(LD, W, IND),
+BPF_A3(LD, H, IND),
+BPF_A3(LD, B, IND),
+BPF_A2(LD, IMM),
+BPF_A3(LDX, W, LEN),
+BPF_A3(LDX, B, MSH),
+BPF_A2(LDX, IMM),
+BPF_A2(MISC, TAX),
+BPF_A2(MISC, TXA),
+BPF_A3(ALU, DIV, K),
+BPF_A2(LD, MEM),
+BPF_A2(LDX, MEM),
+BPF_A1(ST),
+BPF_A1(STX),
+BPF_A2(JMP, JA),
+BPF_A3(JMP, JEQ, K),
+BPF_A3(JMP, JEQ, X),
+BPF_A3(JMP, JGE, K),
+BPF_A3(JMP, JGE, X),
+BPF_A3(JMP, JGT, K),
+BPF_A3(JMP, JGT, X),
+BPF_A3(JMP, JSET, K),
+BPF_A3(JMP, JSET, X),
+#undef BPF_A1
+#undef BPF_A2
+#undef BPF_A3

^ permalink raw reply related

* Re: linux-next: manual merge of the bkl-llseek tree with the wireless tree
From: Tomoki Sekiyama @ 2010-11-19  4:50 UTC (permalink / raw)
  To: Arnd Bergmann, gregkh
  Cc: Stephen Rothwell, John W. Linville, David Miller, netdev,
	linux-next, linux-kernel, Felix Fietkau, Linus, Christoph Hellwig

Hi Arnd,

On 2010-10-23 09:27:35, Arnd Bergmann wrote:
> On Saturday 23 October 2010, Stephen Rothwell wrote:
>> Hi John, Dave,
>>
>> On Mon, 18 Oct 2010 17:35:43 +1100 Stephen Rothwell<sfr@canb.auug.org.au>  wrote:
>>>
>>> Today's linux-next merge of the bkl-llseek tree got a conflict in
>>> drivers/net/wireless/ath/ath9k/debug.c between commit
>>> 772d5515635fef5bc7a9d0efee785b58b0181ee5 ("ath9k: make rate control
>>> debugfs stats per station") from the wireless tree and commit
>>> 6038f373a3dc1f1c26496e60b6c40b164716f07e ("llseek: automatically
>>> add .llseek fop") from the bkl-llseek tree.
<snip>
>> This patch (reproduced below) will now be needed if the wireless or net
>> tree is merged with Linus' tree.  I also think I have missed a similar
>> needed fix in drivers/net/wireless/ath/ath5k/debug.c ...
>
> There are also new drivers for speakup, intel_sst and yurex that introduce
> additional file_operations in next, the patch below is what I had planned
> to submit once everything is in. I also expect the occasional driver that
> did not see linux-next, so I'll rerun my scripts after -rc1 to see what
> we got.

Is your patch that adds .llseek fops planned to be merged to -rc?

The driver for yurex needs your patch that adds .llseek fop
(the hunk below) to work correctly. (tested in 2.6.36-rc2)

diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index 719c618..ac5bfd6 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -536,6 +536,7 @@  static const struct file_operations yurex_fops = {
  	.open =		yurex_open,
  	.release =	yurex_release,
  	.fasync	=	yurex_fasync,
+	.llseek =	default_llseek,
  };


Thanks,
-- 
Tomoki Sekiyama

^ permalink raw reply related

* [PATCH net-next-2.6 1/17] can: EG20T PCH: Separate Interface Register(IF1/IF2)
From: Tomoya MORINAGA @ 2010-11-19  5:43 UTC (permalink / raw)
  To: Wolfgang Grandegger, Wolfram Sang, Christian Pellegrin,
	Barry Song, Samuel Ortiz
  Cc: qi.wang, yong.y.wang, andrew.chih.howe.khor, joel.clark,
	kok.howg.ewe, margie.foster

Separate interface register from whole of register structure.
CAN register of Intel PCH EG20T has 2 sets of interface register.
To reduce whole of code size, separate interface register.
As a result, the number of function also can be reduced.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
---
 drivers/net/can/pch_can.c |  442 ++++++++++++++++++++-------------------------
 1 files changed, 198 insertions(+), 244 deletions(-)

diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 238622a..143f100 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -102,6 +102,9 @@
 #define PCH_MSK_CTRL_IE_SIE_EIE	0x07
 #define PCH_COUNTER_LIMIT	10
 
+#define PCH_RX_IFREG			0
+#define PCH_TX_IFREG			1
+
 #define PCH_CAN_CLK		50000000	/* 50MHz */
 
 /* Define the number of message object.
@@ -122,6 +125,21 @@ enum pch_can_mode {
 	PCH_CAN_RUN
 };
 
+struct pch_can_if_regs {
+	u32 creq;
+	u32 cmask;
+	u32 mask1;
+	u32 mask2;
+	u32 id1;
+	u32 id2;
+	u32 mcont;
+	u32 dataa1;
+	u32 dataa2;
+	u32 datab1;
+	u32 datab2;
+	u32 rsv[13];
+};
+
 struct pch_can_regs {
 	u32 cont;
 	u32 stat;
@@ -130,38 +148,21 @@ struct pch_can_regs {
 	u32 intr;
 	u32 opt;
 	u32 brpe;
-	u32 reserve1;
-	u32 if1_creq;
-	u32 if1_cmask;
-	u32 if1_mask1;
-	u32 if1_mask2;
-	u32 if1_id1;
-	u32 if1_id2;
-	u32 if1_mcont;
-	u32 if1_dataa1;
-	u32 if1_dataa2;
-	u32 if1_datab1;
-	u32 if1_datab2;
-	u32 reserve2;
-	u32 reserve3[12];
-	u32 if2_creq;
-	u32 if2_cmask;
-	u32 if2_mask1;
-	u32 if2_mask2;
-	u32 if2_id1;
-	u32 if2_id2;
-	u32 if2_mcont;
-	u32 if2_dataa1;
-	u32 if2_dataa2;
-	u32 if2_datab1;
-	u32 if2_datab2;
-	u32 reserve4;
-	u32 reserve5[20];
+	u32 reserve;
+	struct pch_can_if_regs ifregs[2]; /* [0]=if1  [1]=if2 */
+	u32 reserve1[8];
 	u32 treq1;
 	u32 treq2;
-	u32 reserve6[2];
-	u32 reserve7[56];
-	u32 reserve8[3];
+	u32 reserve2[6];
+	u32 data1;
+	u32 data2;
+	u32 reserve3[6];
+	u32 canipend1;
+	u32 canipend2;
+	u32 reserve4[6];
+	u32 canmval1;
+	u32 canmval2;
+	u32 reserve5[37];
 	u32 srst;
 };
 
@@ -303,143 +304,86 @@ static void pch_can_check_if_busy(u32 __iomem *creq_addr, u32 num)
 		pr_err("%s:IF1 BUSY Flag is set forever.\n", __func__);
 }
 
-static void pch_can_set_rx_enable(struct pch_can_priv *priv, u32 buff_num,
-				  u32 set)
+static void pch_can_set_rxtx(struct pch_can_priv *priv, u32 buff_num,
+				  u32 set, u32 dir)
 {
 	unsigned long flags;
+	u32 ie;
+
+	if (dir)
+		ie = PCH_IF_MCONT_TXIE;
+	else
+		ie = PCH_IF_MCONT_RXIE;
 
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 	/* Reading the receive buffer data from RAM to Interface1 registers */
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if1_cmask);
-	pch_can_check_if_busy(&priv->regs->if1_creq, buff_num);
+	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[dir].cmask);
+	pch_can_check_if_busy(&priv->regs->ifregs[dir].creq, buff_num);
 
 	/* Setting the IF1MASK1 register to access MsgVal and RxIE bits */
 	iowrite32(PCH_CMASK_RDWR | PCH_CMASK_ARB | PCH_CMASK_CTRL,
-		  &priv->regs->if1_cmask);
+		  &priv->regs->ifregs[dir].cmask);
 
 	if (set == PCH_ENABLE) {
 		/* Setting the MsgVal and RxIE bits */
-		pch_can_bit_set(&priv->regs->if1_mcont, PCH_IF_MCONT_RXIE);
-		pch_can_bit_set(&priv->regs->if1_id2, PCH_ID_MSGVAL);
+		pch_can_bit_set(&priv->regs->ifregs[dir].mcont, ie);
+		pch_can_bit_set(&priv->regs->ifregs[dir].id2, PCH_ID_MSGVAL);
 
 	} else if (set == PCH_DISABLE) {
 		/* Resetting the MsgVal and RxIE bits */
-		pch_can_bit_clear(&priv->regs->if1_mcont, PCH_IF_MCONT_RXIE);
-		pch_can_bit_clear(&priv->regs->if1_id2, PCH_ID_MSGVAL);
+		pch_can_bit_clear(&priv->regs->ifregs[dir].mcont, ie);
+		pch_can_bit_clear(&priv->regs->ifregs[dir].id2, PCH_ID_MSGVAL);
 	}
 
-	pch_can_check_if_busy(&priv->regs->if1_creq, buff_num);
+	pch_can_check_if_busy(&priv->regs->ifregs[dir].creq, buff_num);
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 }
 
-static void pch_can_rx_enable_all(struct pch_can_priv *priv)
-{
-	int i;
-
-	/* Traversing to obtain the object configured as receivers. */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX)
-			pch_can_set_rx_enable(priv, i + 1, PCH_ENABLE);
-	}
-}
 
-static void pch_can_rx_disable_all(struct pch_can_priv *priv)
+static void pch_can_set_rx_all(struct pch_can_priv *priv, u32 set)
 {
 	int i;
 
 	/* Traversing to obtain the object configured as receivers. */
 	for (i = 0; i < PCH_OBJ_NUM; i++) {
 		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX)
-			pch_can_set_rx_enable(priv, i + 1, PCH_DISABLE);
+			pch_can_set_rxtx(priv, i + 1, set, PCH_RX_IFREG);
 	}
 }
 
-static void pch_can_set_tx_enable(struct pch_can_priv *priv, u32 buff_num,
-				 u32 set)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-	/* Reading the Msg buffer from Message RAM to Interface2 registers. */
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if2_cmask);
-	pch_can_check_if_busy(&priv->regs->if2_creq, buff_num);
-
-	/* Setting the IF2CMASK register for accessing the
-		MsgVal and TxIE bits */
-	iowrite32(PCH_CMASK_RDWR | PCH_CMASK_ARB | PCH_CMASK_CTRL,
-		 &priv->regs->if2_cmask);
-
-	if (set == PCH_ENABLE) {
-		/* Setting the MsgVal and TxIE bits */
-		pch_can_bit_set(&priv->regs->if2_mcont, PCH_IF_MCONT_TXIE);
-		pch_can_bit_set(&priv->regs->if2_id2, PCH_ID_MSGVAL);
-	} else if (set == PCH_DISABLE) {
-		/* Resetting the MsgVal and TxIE bits. */
-		pch_can_bit_clear(&priv->regs->if2_mcont, PCH_IF_MCONT_TXIE);
-		pch_can_bit_clear(&priv->regs->if2_id2, PCH_ID_MSGVAL);
-	}
-
-	pch_can_check_if_busy(&priv->regs->if2_creq, buff_num);
-	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
-}
-
-static void pch_can_tx_enable_all(struct pch_can_priv *priv)
-{
-	int i;
-
-	/* Traversing to obtain the object configured as transmit object. */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
-			pch_can_set_tx_enable(priv, i + 1, PCH_ENABLE);
-	}
-}
-
-static void pch_can_tx_disable_all(struct pch_can_priv *priv)
+static void pch_can_set_tx_all(struct pch_can_priv *priv, u32 set)
 {
 	int i;
 
 	/* Traversing to obtain the object configured as transmit object. */
 	for (i = 0; i < PCH_OBJ_NUM; i++) {
 		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
-			pch_can_set_tx_enable(priv, i + 1, PCH_DISABLE);
+			pch_can_set_rxtx(priv, i + 1, set, PCH_ENABLE);
 	}
 }
 
-static void pch_can_get_rx_enable(struct pch_can_priv *priv, u32 buff_num,
-				 u32 *enable)
+static u32 pch_can_get_rxtx_ir(struct pch_can_priv *priv, u32 buff_num, u32 dir)
 {
 	unsigned long flags;
+	u32 ie, enable;
 
-	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if1_cmask);
-	pch_can_check_if_busy(&priv->regs->if1_creq, buff_num);
-
-	if (((ioread32(&priv->regs->if1_id2)) & PCH_ID_MSGVAL) &&
-			((ioread32(&priv->regs->if1_mcont)) &
-			PCH_IF_MCONT_RXIE))
-		*enable = PCH_ENABLE;
+	if (dir)
+		ie = PCH_IF_MCONT_RXIE;
 	else
-		*enable = PCH_DISABLE;
-	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
-}
-
-static void pch_can_get_tx_enable(struct pch_can_priv *priv, u32 buff_num,
-				 u32 *enable)
-{
-	unsigned long flags;
+		ie = PCH_IF_MCONT_TXIE;
 
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if2_cmask);
-	pch_can_check_if_busy(&priv->regs->if2_creq, buff_num);
+	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[dir].cmask);
+	pch_can_check_if_busy(&priv->regs->ifregs[dir].creq, buff_num);
 
-	if (((ioread32(&priv->regs->if2_id2)) & PCH_ID_MSGVAL) &&
-			((ioread32(&priv->regs->if2_mcont)) &
-			PCH_IF_MCONT_TXIE)) {
-		*enable = PCH_ENABLE;
+	if (((ioread32(&priv->regs->ifregs[dir].id2)) & PCH_ID_MSGVAL) &&
+			((ioread32(&priv->regs->ifregs[dir].mcont)) & ie)) {
+		enable = PCH_ENABLE;
 	} else {
-		*enable = PCH_DISABLE;
+		enable = PCH_DISABLE;
 	}
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
+	return enable;
 }
 
 static int pch_can_int_pending(struct pch_can_priv *priv)
@@ -453,15 +397,17 @@ static void pch_can_set_rx_buffer_link(struct pch_can_priv *priv,
 	unsigned long flags;
 
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if1_cmask);
-	pch_can_check_if_busy(&priv->regs->if1_creq, buffer_num);
-	iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL, &priv->regs->if1_cmask);
+	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
+	pch_can_check_if_busy(&priv->regs->ifregs[0].creq, buffer_num);
+	iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL,
+		  &priv->regs->ifregs[0].cmask);
 	if (set == PCH_ENABLE)
-		pch_can_bit_clear(&priv->regs->if1_mcont, PCH_IF_MCONT_EOB);
+		pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
+				  PCH_IF_MCONT_EOB);
 	else
-		pch_can_bit_set(&priv->regs->if1_mcont, PCH_IF_MCONT_EOB);
+		pch_can_bit_set(&priv->regs->ifregs[0].mcont, PCH_IF_MCONT_EOB);
 
-	pch_can_check_if_busy(&priv->regs->if1_creq, buffer_num);
+	pch_can_check_if_busy(&priv->regs->ifregs[0].creq, buffer_num);
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 }
 
@@ -471,10 +417,10 @@ static void pch_can_get_rx_buffer_link(struct pch_can_priv *priv,
 	unsigned long flags;
 
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if1_cmask);
-	pch_can_check_if_busy(&priv->regs->if1_creq, buffer_num);
+	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
+	pch_can_check_if_busy(&priv->regs->ifregs[0].creq, buffer_num);
 
-	if (ioread32(&priv->regs->if1_mcont) & PCH_IF_MCONT_EOB)
+	if (ioread32(&priv->regs->ifregs[0].mcont) & PCH_IF_MCONT_EOB)
 		*link = PCH_DISABLE;
 	else
 		*link = PCH_ENABLE;
@@ -486,37 +432,37 @@ static void pch_can_clear_buffers(struct pch_can_priv *priv)
 	int i;
 
 	for (i = 0; i < PCH_RX_OBJ_NUM; i++) {
-		iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->if1_cmask);
-		iowrite32(0xffff, &priv->regs->if1_mask1);
-		iowrite32(0xffff, &priv->regs->if1_mask2);
-		iowrite32(0x0, &priv->regs->if1_id1);
-		iowrite32(0x0, &priv->regs->if1_id2);
-		iowrite32(0x0, &priv->regs->if1_mcont);
-		iowrite32(0x0, &priv->regs->if1_dataa1);
-		iowrite32(0x0, &priv->regs->if1_dataa2);
-		iowrite32(0x0, &priv->regs->if1_datab1);
-		iowrite32(0x0, &priv->regs->if1_datab2);
+		iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->ifregs[0].cmask);
+		iowrite32(0xffff, &priv->regs->ifregs[0].mask1);
+		iowrite32(0xffff, &priv->regs->ifregs[0].mask2);
+		iowrite32(0x0, &priv->regs->ifregs[0].id1);
+		iowrite32(0x0, &priv->regs->ifregs[0].id2);
+		iowrite32(0x0, &priv->regs->ifregs[0].mcont);
+		iowrite32(0x0, &priv->regs->ifregs[0].dataa1);
+		iowrite32(0x0, &priv->regs->ifregs[0].dataa2);
+		iowrite32(0x0, &priv->regs->ifregs[0].datab1);
+		iowrite32(0x0, &priv->regs->ifregs[0].datab2);
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
 			  PCH_CMASK_ARB | PCH_CMASK_CTRL,
-			  &priv->regs->if1_cmask);
-		pch_can_check_if_busy(&priv->regs->if1_creq, i+1);
+			  &priv->regs->ifregs[0].cmask);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i+1);
 	}
 
 	for (i = i;  i < PCH_OBJ_NUM; i++) {
-		iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->if2_cmask);
-		iowrite32(0xffff, &priv->regs->if2_mask1);
-		iowrite32(0xffff, &priv->regs->if2_mask2);
-		iowrite32(0x0, &priv->regs->if2_id1);
-		iowrite32(0x0, &priv->regs->if2_id2);
-		iowrite32(0x0, &priv->regs->if2_mcont);
-		iowrite32(0x0, &priv->regs->if2_dataa1);
-		iowrite32(0x0, &priv->regs->if2_dataa2);
-		iowrite32(0x0, &priv->regs->if2_datab1);
-		iowrite32(0x0, &priv->regs->if2_datab2);
+		iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->ifregs[1].cmask);
+		iowrite32(0xffff, &priv->regs->ifregs[1].mask1);
+		iowrite32(0xffff, &priv->regs->ifregs[1].mask2);
+		iowrite32(0x0, &priv->regs->ifregs[1].id1);
+		iowrite32(0x0, &priv->regs->ifregs[1].id2);
+		iowrite32(0x0, &priv->regs->ifregs[1].mcont);
+		iowrite32(0x0, &priv->regs->ifregs[1].dataa1);
+		iowrite32(0x0, &priv->regs->ifregs[1].dataa2);
+		iowrite32(0x0, &priv->regs->ifregs[1].datab1);
+		iowrite32(0x0, &priv->regs->ifregs[1].datab2);
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
 			  PCH_CMASK_ARB | PCH_CMASK_CTRL,
-			  &priv->regs->if2_cmask);
-		pch_can_check_if_busy(&priv->regs->if2_creq, i+1);
+			  &priv->regs->ifregs[1].cmask);
+		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i+1);
 	}
 }
 
@@ -530,58 +476,60 @@ static void pch_can_config_rx_tx_buffers(struct pch_can_priv *priv)
 	for (i = 0; i < PCH_OBJ_NUM; i++) {
 		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX) {
 			iowrite32(PCH_CMASK_RX_TX_GET,
-				&priv->regs->if1_cmask);
-			pch_can_check_if_busy(&priv->regs->if1_creq, i+1);
+				&priv->regs->ifregs[0].cmask);
+			pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i+1);
 
-			iowrite32(0x0, &priv->regs->if1_id1);
-			iowrite32(0x0, &priv->regs->if1_id2);
+			iowrite32(0x0, &priv->regs->ifregs[0].id1);
+			iowrite32(0x0, &priv->regs->ifregs[0].id2);
 
-			pch_can_bit_set(&priv->regs->if1_mcont,
+			pch_can_bit_set(&priv->regs->ifregs[0].mcont,
 					PCH_IF_MCONT_UMASK);
 
 			/* Set FIFO mode set to 0 except last Rx Obj*/
-			pch_can_bit_clear(&priv->regs->if1_mcont,
+			pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
 					  PCH_IF_MCONT_EOB);
 			/* In case FIFO mode, Last EoB of Rx Obj must be 1 */
 			if (i == (PCH_RX_OBJ_NUM - 1))
-				pch_can_bit_set(&priv->regs->if1_mcont,
+				pch_can_bit_set(&priv->regs->ifregs[0].mcont,
 						  PCH_IF_MCONT_EOB);
 
-			iowrite32(0, &priv->regs->if1_mask1);
-			pch_can_bit_clear(&priv->regs->if1_mask2,
+			iowrite32(0, &priv->regs->ifregs[0].mask1);
+			pch_can_bit_clear(&priv->regs->ifregs[0].mask2,
 					  0x1fff | PCH_MASK2_MDIR_MXTD);
 
 			/* Setting CMASK for writing */
 			iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
 				  PCH_CMASK_ARB | PCH_CMASK_CTRL,
-				  &priv->regs->if1_cmask);
+				  &priv->regs->ifregs[0].cmask);
 
-			pch_can_check_if_busy(&priv->regs->if1_creq, i+1);
+			pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i+1);
 		} else if (priv->msg_obj[i] == PCH_MSG_OBJ_TX) {
 			iowrite32(PCH_CMASK_RX_TX_GET,
-				&priv->regs->if2_cmask);
-			pch_can_check_if_busy(&priv->regs->if2_creq, i+1);
+				&priv->regs->ifregs[1].cmask);
+			pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i+1);
 
 			/* Resetting DIR bit for reception */
-			iowrite32(0x0, &priv->regs->if2_id1);
-			iowrite32(0x0, &priv->regs->if2_id2);
-			pch_can_bit_set(&priv->regs->if2_id2, PCH_ID2_DIR);
+			iowrite32(0x0, &priv->regs->ifregs[1].id1);
+			iowrite32(0x0, &priv->regs->ifregs[1].id2);
+			pch_can_bit_set(&priv->regs->ifregs[1].id2,
+					PCH_ID2_DIR);
 
 			/* Setting EOB bit for transmitter */
-			iowrite32(PCH_IF_MCONT_EOB, &priv->regs->if2_mcont);
+			iowrite32(PCH_IF_MCONT_EOB,
+				  &priv->regs->ifregs[1].mcont);
 
-			pch_can_bit_set(&priv->regs->if2_mcont,
+			pch_can_bit_set(&priv->regs->ifregs[1].mcont,
 					PCH_IF_MCONT_UMASK);
 
-			iowrite32(0, &priv->regs->if2_mask1);
-			pch_can_bit_clear(&priv->regs->if2_mask2, 0x1fff);
+			iowrite32(0, &priv->regs->ifregs[1].mask1);
+			pch_can_bit_clear(&priv->regs->ifregs[1].mask2, 0x1fff);
 
 			/* Setting CMASK for writing */
 			iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
 				  PCH_CMASK_ARB | PCH_CMASK_CTRL,
-				  &priv->regs->if2_cmask);
+				  &priv->regs->ifregs[1].cmask);
 
-			pch_can_check_if_busy(&priv->regs->if2_creq, i+1);
+			pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i+1);
 		}
 	}
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
@@ -611,10 +559,10 @@ static void pch_can_release(struct pch_can_priv *priv)
 	pch_can_set_int_enables(priv, PCH_CAN_NONE);
 
 	/* Disabling all the receive object. */
-	pch_can_rx_disable_all(priv);
+	pch_can_set_rx_all(priv, 0);
 
 	/* Disabling all the transmit object. */
-	pch_can_tx_disable_all(priv);
+	pch_can_set_tx_all(priv, 0);
 }
 
 /* This function clears interrupt(s) from the CAN device. */
@@ -630,31 +578,31 @@ static void pch_can_int_clr(struct pch_can_priv *priv, u32 mask)
 		/* Setting CMASK for clearing interrupts for
 					 frame transmission. */
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
-			  &priv->regs->if2_cmask);
+			  &priv->regs->ifregs[1].cmask);
 
 		/* Resetting the ID registers. */
-		pch_can_bit_set(&priv->regs->if2_id2,
+		pch_can_bit_set(&priv->regs->ifregs[1].id2,
 			       PCH_ID2_DIR | (0x7ff << 2));
-		iowrite32(0x0, &priv->regs->if2_id1);
+		iowrite32(0x0, &priv->regs->ifregs[1].id1);
 
 		/* Claring NewDat, TxRqst & IntPnd */
-		pch_can_bit_clear(&priv->regs->if2_mcont,
+		pch_can_bit_clear(&priv->regs->ifregs[1].mcont,
 				  PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND |
 				  PCH_IF_MCONT_TXRQXT);
-		pch_can_check_if_busy(&priv->regs->if2_creq, mask);
+		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, mask);
 	} else if (priv->msg_obj[mask - 1] == PCH_MSG_OBJ_RX) {
 		/* Setting CMASK for clearing the reception interrupts. */
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
-			  &priv->regs->if1_cmask);
+			  &priv->regs->ifregs[0].cmask);
 
 		/* Clearing the Dir bit. */
-		pch_can_bit_clear(&priv->regs->if1_id2, PCH_ID2_DIR);
+		pch_can_bit_clear(&priv->regs->ifregs[0].id2, PCH_ID2_DIR);
 
 		/* Clearing NewDat & IntPnd */
-		pch_can_bit_clear(&priv->regs->if1_mcont,
+		pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
 				  PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND);
 
-		pch_can_check_if_busy(&priv->regs->if1_creq, mask);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, mask);
 	}
 }
 
@@ -685,8 +633,8 @@ static void pch_can_error(struct net_device *ndev, u32 status)
 		return;
 
 	if (status & PCH_BUS_OFF) {
-		pch_can_tx_disable_all(priv);
-		pch_can_rx_disable_all(priv);
+		pch_can_set_tx_all(priv, 0);
+		pch_can_set_rx_all(priv, 0);
 		state = CAN_STATE_BUS_OFF;
 		cf->can_id |= CAN_ERR_BUSOFF;
 		can_bus_off(ndev);
@@ -783,22 +731,22 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
 	struct net_device_stats *stats = &(priv->ndev->stats);
 
 	/* Reading the messsage object from the Message RAM */
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if1_cmask);
-	pch_can_check_if_busy(&priv->regs->if1_creq, int_stat);
+	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
+	pch_can_check_if_busy(&priv->regs->ifregs[0].creq, int_stat);
 
 	/* Reading the MCONT register. */
-	reg = ioread32(&priv->regs->if1_mcont);
+	reg = ioread32(&priv->regs->ifregs[0].mcont);
 	reg &= 0xffff;
 
 	for (k = int_stat; !(reg & PCH_IF_MCONT_EOB); k++) {
 		/* If MsgLost bit set. */
 		if (reg & PCH_IF_MCONT_MSGLOST) {
 			dev_err(&priv->ndev->dev, "Msg Obj is overwritten.\n");
-			pch_can_bit_clear(&priv->regs->if1_mcont,
+			pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
 					  PCH_IF_MCONT_MSGLOST);
 			iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL,
-				  &priv->regs->if1_cmask);
-			pch_can_check_if_busy(&priv->regs->if1_creq, k);
+				  &priv->regs->ifregs[0].cmask);
+			pch_can_check_if_busy(&priv->regs->ifregs[0].creq, k);
 
 			skb = alloc_can_err_skb(ndev, &cf);
 			if (!skb)
@@ -824,29 +772,30 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
 			return -ENOMEM;
 
 		/* Get Received data */
-		ide = ((ioread32(&priv->regs->if1_id2)) & PCH_ID2_XTD) >> 14;
+		ide = ((ioread32(&priv->regs->ifregs[0].id2)) & PCH_ID2_XTD) >>
+									     14;
 		if (ide) {
-			id = (ioread32(&priv->regs->if1_id1) & 0xffff);
-			id |= (((ioread32(&priv->regs->if1_id2)) &
+			id = (ioread32(&priv->regs->ifregs[0].id1) & 0xffff);
+			id |= (((ioread32(&priv->regs->ifregs[0].id2)) &
 					    0x1fff) << 16);
 			cf->can_id = (id & CAN_EFF_MASK) | CAN_EFF_FLAG;
 		} else {
-			id = (((ioread32(&priv->regs->if1_id2)) &
-					  (CAN_SFF_MASK << 2)) >> 2);
+			id = (((ioread32(&priv->regs->ifregs[0].id2)) &
+						     (CAN_SFF_MASK << 2)) >> 2);
 			cf->can_id = (id & CAN_SFF_MASK);
 		}
 
-		rtr = (ioread32(&priv->regs->if1_id2) &  PCH_ID2_DIR);
+		rtr = (ioread32(&priv->regs->ifregs[0].id2) &  PCH_ID2_DIR);
 		if (rtr) {
 			cf->can_dlc = 0;
 			cf->can_id |= CAN_RTR_FLAG;
 		} else {
-			cf->can_dlc = ((ioread32(&priv->regs->if1_mcont)) &
-						   0x0f);
+			cf->can_dlc = ((ioread32(&priv->regs->ifregs[0].mcont))
+						 & 0x0f);
 		}
 
 		for (i = 0, j = 0; i < cf->can_dlc; j++) {
-			reg = ioread32(&priv->regs->if1_dataa1 + j*4);
+			reg = ioread32(&priv->regs->ifregs[0].dataa1 + j*4);
 			cf->data[i++] = cpu_to_le32(reg & 0xff);
 			if (i == cf->can_dlc)
 				break;
@@ -860,15 +809,16 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
 
 		if (k < PCH_FIFO_THRESH) {
 			iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL |
-				  PCH_CMASK_ARB, &priv->regs->if1_cmask);
+				  PCH_CMASK_ARB, &priv->regs->ifregs[0].cmask);
 
 			/* Clearing the Dir bit. */
-			pch_can_bit_clear(&priv->regs->if1_id2, PCH_ID2_DIR);
+			pch_can_bit_clear(&priv->regs->ifregs[0].id2,
+					  PCH_ID2_DIR);
 
 			/* Clearing NewDat & IntPnd */
-			pch_can_bit_clear(&priv->regs->if1_mcont,
+			pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
 					  PCH_IF_MCONT_INTPND);
-			pch_can_check_if_busy(&priv->regs->if1_creq, k);
+			pch_can_check_if_busy(&priv->regs->ifregs[0].creq, k);
 		} else if (k > PCH_FIFO_THRESH) {
 			pch_can_int_clr(priv, k);
 		} else if (k == PCH_FIFO_THRESH) {
@@ -878,9 +828,9 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
 		}
 RX_NEXT:
 		/* Reading the messsage object from the Message RAM */
-		iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if1_cmask);
-		pch_can_check_if_busy(&priv->regs->if1_creq, k + 1);
-		reg = ioread32(&priv->regs->if1_mcont);
+		iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, k + 1);
+		reg = ioread32(&priv->regs->ifregs[0].mcont);
 	}
 
 	return rcv_pkts;
@@ -910,8 +860,9 @@ INT_STAT:
 
 		if (reg_stat & PCH_TX_OK) {
 			spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-			iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if2_cmask);
-			pch_can_check_if_busy(&priv->regs->if2_creq,
+			iowrite32(PCH_CMASK_RX_TX_GET,
+				  &priv->regs->ifregs[1].cmask);
+			pch_can_check_if_busy(&priv->regs->ifregs[1].creq,
 					       ioread32(&priv->regs->intr));
 			spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 			pch_can_bit_clear(&priv->regs->stat, PCH_TX_OK);
@@ -938,10 +889,11 @@ MSG_OBJ:
 			can_get_echo_skb(ndev, int_stat - PCH_RX_OBJ_NUM - 1);
 			spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 			iowrite32(PCH_CMASK_RX_TX_GET | PCH_CMASK_CLRINTPND,
-				  &priv->regs->if2_cmask);
-			dlc = ioread32(&priv->regs->if2_mcont) &
+				  &priv->regs->ifregs[1].cmask);
+			dlc = ioread32(&priv->regs->ifregs[1].mcont) &
 				       PCH_IF_MCONT_DLC;
-			pch_can_check_if_busy(&priv->regs->if2_creq, int_stat);
+			pch_can_check_if_busy(&priv->regs->ifregs[1].creq,
+					      int_stat);
 			spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 			if (dlc > 8)
 				dlc = 8;
@@ -996,8 +948,8 @@ static void pch_can_start(struct net_device *ndev)
 	pch_set_bittiming(ndev);
 	pch_can_set_optmode(priv);
 
-	pch_can_tx_enable_all(priv);
-	pch_can_rx_enable_all(priv);
+	pch_can_set_tx_all(priv, 1);
+	pch_can_set_rx_all(priv, 1);
 
 	/* Setting the CAN to run mode. */
 	pch_can_set_run_mode(priv, PCH_CAN_RUN);
@@ -1125,54 +1077,55 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 
 	/* Reading the Msg Obj from the Msg RAM to the Interface register. */
-	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->if2_cmask);
-	pch_can_check_if_busy(&priv->regs->if2_creq, tx_buffer_avail);
+	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[1].cmask);
+	pch_can_check_if_busy(&priv->regs->ifregs[1].creq, tx_buffer_avail);
 
 	/* Setting the CMASK register. */
-	pch_can_bit_set(&priv->regs->if2_cmask, PCH_CMASK_ALL);
+	pch_can_bit_set(&priv->regs->ifregs[1].cmask, PCH_CMASK_ALL);
 
 	/* If ID extended is set. */
-	pch_can_bit_clear(&priv->regs->if2_id1, 0xffff);
-	pch_can_bit_clear(&priv->regs->if2_id2, 0x1fff | PCH_ID2_XTD);
+	pch_can_bit_clear(&priv->regs->ifregs[1].id1, 0xffff);
+	pch_can_bit_clear(&priv->regs->ifregs[1].id2, 0x1fff | PCH_ID2_XTD);
 	if (cf->can_id & CAN_EFF_FLAG) {
-		pch_can_bit_set(&priv->regs->if2_id1, cf->can_id & 0xffff);
-		pch_can_bit_set(&priv->regs->if2_id2,
+		pch_can_bit_set(&priv->regs->ifregs[1].id1,
+				cf->can_id & 0xffff);
+		pch_can_bit_set(&priv->regs->ifregs[1].id2,
 				((cf->can_id >> 16) & 0x1fff) | PCH_ID2_XTD);
 	} else {
-		pch_can_bit_set(&priv->regs->if2_id1, 0);
-		pch_can_bit_set(&priv->regs->if2_id2,
+		pch_can_bit_set(&priv->regs->ifregs[1].id1, 0);
+		pch_can_bit_set(&priv->regs->ifregs[1].id2,
 				(cf->can_id & CAN_SFF_MASK) << 2);
 	}
 
 	/* If remote frame has to be transmitted.. */
 	if (cf->can_id & CAN_RTR_FLAG)
-		pch_can_bit_clear(&priv->regs->if2_id2, PCH_ID2_DIR);
+		pch_can_bit_clear(&priv->regs->ifregs[1].id2, PCH_ID2_DIR);
 
 	for (i = 0, j = 0; i < cf->can_dlc; j++) {
 		iowrite32(le32_to_cpu(cf->data[i++]),
-			 (&priv->regs->if2_dataa1) + j*4);
+			 (&priv->regs->ifregs[1].dataa1) + j*4);
 		if (i == cf->can_dlc)
 			break;
 		iowrite32(le32_to_cpu(cf->data[i++] << 8),
-			 (&priv->regs->if2_dataa1) + j*4);
+			 (&priv->regs->ifregs[1].dataa1) + j*4);
 	}
 
 	can_put_echo_skb(skb, ndev, tx_buffer_avail - PCH_RX_OBJ_NUM - 1);
 
 	/* Updating the size of the data. */
-	pch_can_bit_clear(&priv->regs->if2_mcont, 0x0f);
-	pch_can_bit_set(&priv->regs->if2_mcont, cf->can_dlc);
+	pch_can_bit_clear(&priv->regs->ifregs[1].mcont, 0x0f);
+	pch_can_bit_set(&priv->regs->ifregs[1].mcont, cf->can_dlc);
 
 	/* Clearing IntPend, NewDat & TxRqst */
-	pch_can_bit_clear(&priv->regs->if2_mcont,
+	pch_can_bit_clear(&priv->regs->ifregs[1].mcont,
 			  PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND |
 			  PCH_IF_MCONT_TXRQXT);
 
 	/* Setting NewDat, TxRqst bits */
-	pch_can_bit_set(&priv->regs->if2_mcont,
+	pch_can_bit_set(&priv->regs->ifregs[1].mcont,
 			PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_TXRQXT);
 
-	pch_can_check_if_busy(&priv->regs->if2_creq, tx_buffer_avail);
+	pch_can_check_if_busy(&priv->regs->ifregs[1].creq, tx_buffer_avail);
 
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 
@@ -1234,25 +1187,25 @@ static int pch_can_suspend(struct pci_dev *pdev, pm_message_t state)
 	/* Save Tx buffer enable state */
 	for (i = 0; i < PCH_OBJ_NUM; i++) {
 		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
-			pch_can_get_tx_enable(priv, i + 1,
-					      &(priv->tx_enable[i]));
+			priv->tx_enable[i] = pch_can_get_rxtx_ir(priv, i + 1,
+								 PCH_TX_IFREG);
 	}
 
 	/* Disable all Transmit buffers */
-	pch_can_tx_disable_all(priv);
+	pch_can_set_tx_all(priv, 0);
 
 	/* Save Rx buffer enable state */
 	for (i = 0; i < PCH_OBJ_NUM; i++) {
 		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX) {
-			pch_can_get_rx_enable(priv, i + 1,
-						&(priv->rx_enable[i]));
+			priv->rx_enable[i] = pch_can_get_rxtx_ir(priv, i + 1,
+						PCH_RX_IFREG);
 			pch_can_get_rx_buffer_link(priv, i + 1,
 						&(priv->rx_link[i]));
 		}
 	}
 
 	/* Disable all Receive buffers */
-	pch_can_rx_disable_all(priv);
+	pch_can_set_rx_all(priv, 0);
 	retval = pci_save_state(pdev);
 	if (retval) {
 		dev_err(&pdev->dev, "pci_save_state failed.\n");
@@ -1301,10 +1254,9 @@ static int pch_can_resume(struct pci_dev *pdev)
 
 	/* Enabling the transmit buffer. */
 	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX) {
-			pch_can_set_tx_enable(priv, i + 1,
-					      priv->tx_enable[i]);
-		}
+		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
+			pch_can_set_rxtx(priv, i, priv->tx_enable[i],
+					 PCH_TX_IFREG);
 	}
 
 	/* Configuring the receive buffer and enabling them. */
@@ -1315,7 +1267,9 @@ static int pch_can_resume(struct pci_dev *pdev)
 						   priv->rx_link[i]);
 
 			/* Restore buffer enables */
-			pch_can_set_rx_enable(priv, i + 1, priv->rx_enable[i]);
+			pch_can_set_rxtx(priv, i, priv->rx_enable[i],
+					 PCH_RX_IFREG);
+
 		}
 	}
 
-- 
1.6.0.6


^ permalink raw reply related

* [PATCH net-next-2.6 2/17] can: EG20T PCH: Change Message Object Index
From: Tomoya MORINAGA @ 2010-11-19  5:44 UTC (permalink / raw)
  To: Wolfgang Grandegger, Wolfram Sang, Christian Pellegrin,
	Barry Song, Samuel Ortiz
  Cc: qi.wang, yong.y.wang, andrew.chih.howe.khor, joel.clark,
	kok.howg.ewe, margie.foster

Change Message Object index macro name.
For easy to readable, add Message Object index like below.
PCH_RX_OBJ_START
PCH_RX_OBJ_END
PCH_TX_OBJ_START
PCH_TX_OBJ_END

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
---
 drivers/net/can/pch_can.c |  288 ++++++++++++++++++++-------------------------
 1 files changed, 128 insertions(+), 160 deletions(-)

diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 143f100..b028ae4 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -32,12 +32,6 @@
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
 
-#define PCH_MAX_MSG_OBJ		32
-#define PCH_MSG_OBJ_RX		0 /* The receive message object flag. */
-#define PCH_MSG_OBJ_TX		1 /* The transmit message object flag. */
-
-#define PCH_ENABLE		1 /* The enable flag */
-#define PCH_DISABLE		0 /* The disable flag */
 #define PCH_CTRL_INIT		BIT(0) /* The INIT bit of CANCONT register. */
 #define PCH_CTRL_IE		BIT(1) /* The IE bit of CAN control register */
 #define PCH_CTRL_IE_SIE_EIE	(BIT(3) | BIT(2) | BIT(1))
@@ -110,9 +104,12 @@
 /* Define the number of message object.
  * PCH CAN communications are done via Message RAM.
  * The Message RAM consists of 32 message objects. */
-#define PCH_RX_OBJ_NUM		26  /* 1~ PCH_RX_OBJ_NUM is Rx*/
-#define PCH_TX_OBJ_NUM		6  /* PCH_RX_OBJ_NUM is RX ~ Tx*/
-#define PCH_OBJ_NUM		(PCH_TX_OBJ_NUM + PCH_RX_OBJ_NUM)
+#define PCH_RX_OBJ_NUM		26
+#define PCH_TX_OBJ_NUM		6
+#define PCH_RX_OBJ_START	1
+#define PCH_RX_OBJ_END		PCH_RX_OBJ_NUM
+#define PCH_TX_OBJ_START	(PCH_RX_OBJ_END + 1)
+#define PCH_TX_OBJ_END		(PCH_RX_OBJ_NUM + PCH_TX_OBJ_NUM)
 
 #define PCH_FIFO_THRESH		16
 
@@ -170,14 +167,14 @@ struct pch_can_priv {
 	struct can_priv can;
 	unsigned int can_num;
 	struct pci_dev *dev;
-	unsigned int tx_enable[PCH_MAX_MSG_OBJ];
-	unsigned int rx_enable[PCH_MAX_MSG_OBJ];
-	unsigned int rx_link[PCH_MAX_MSG_OBJ];
+	int tx_enable[PCH_TX_OBJ_END];
+	int rx_enable[PCH_TX_OBJ_END];
+	int rx_link[PCH_TX_OBJ_END];
 	unsigned int int_enables;
 	unsigned int int_stat;
 	struct net_device *ndev;
 	spinlock_t msgif_reg_lock; /* Message Interface Registers Access Lock*/
-	unsigned int msg_obj[PCH_MAX_MSG_OBJ];
+	unsigned int msg_obj[PCH_TX_OBJ_END];
 	struct pch_can_regs __iomem *regs;
 	struct napi_struct napi;
 	unsigned int tx_obj;	/* Point next Tx Obj index */
@@ -305,7 +302,7 @@ static void pch_can_check_if_busy(u32 __iomem *creq_addr, u32 num)
 }
 
 static void pch_can_set_rxtx(struct pch_can_priv *priv, u32 buff_num,
-				  u32 set, u32 dir)
+				  int set, u32 dir)
 {
 	unsigned long flags;
 	u32 ie;
@@ -324,12 +321,12 @@ static void pch_can_set_rxtx(struct pch_can_priv *priv, u32 buff_num,
 	iowrite32(PCH_CMASK_RDWR | PCH_CMASK_ARB | PCH_CMASK_CTRL,
 		  &priv->regs->ifregs[dir].cmask);
 
-	if (set == PCH_ENABLE) {
+	if (set) {
 		/* Setting the MsgVal and RxIE bits */
 		pch_can_bit_set(&priv->regs->ifregs[dir].mcont, ie);
 		pch_can_bit_set(&priv->regs->ifregs[dir].id2, PCH_ID_MSGVAL);
 
-	} else if (set == PCH_DISABLE) {
+	} else {
 		/* Resetting the MsgVal and RxIE bits */
 		pch_can_bit_clear(&priv->regs->ifregs[dir].mcont, ie);
 		pch_can_bit_clear(&priv->regs->ifregs[dir].id2, PCH_ID_MSGVAL);
@@ -340,26 +337,22 @@ static void pch_can_set_rxtx(struct pch_can_priv *priv, u32 buff_num,
 }
 
 
-static void pch_can_set_rx_all(struct pch_can_priv *priv, u32 set)
+static void pch_can_set_rx_all(struct pch_can_priv *priv, int set)
 {
 	int i;
 
 	/* Traversing to obtain the object configured as receivers. */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX)
-			pch_can_set_rxtx(priv, i + 1, set, PCH_RX_IFREG);
-	}
+	for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++)
+		pch_can_set_rxtx(priv, i, set, PCH_RX_IFREG);
 }
 
-static void pch_can_set_tx_all(struct pch_can_priv *priv, u32 set)
+static void pch_can_set_tx_all(struct pch_can_priv *priv, int set)
 {
 	int i;
 
 	/* Traversing to obtain the object configured as transmit object. */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
-			pch_can_set_rxtx(priv, i + 1, set, PCH_ENABLE);
-	}
+	for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
+		pch_can_set_rxtx(priv, i, set, 1);
 }
 
 static u32 pch_can_get_rxtx_ir(struct pch_can_priv *priv, u32 buff_num, u32 dir)
@@ -378,9 +371,9 @@ static u32 pch_can_get_rxtx_ir(struct pch_can_priv *priv, u32 buff_num, u32 dir)
 
 	if (((ioread32(&priv->regs->ifregs[dir].id2)) & PCH_ID_MSGVAL) &&
 			((ioread32(&priv->regs->ifregs[dir].mcont)) & ie)) {
-		enable = PCH_ENABLE;
+		enable = 1;
 	} else {
-		enable = PCH_DISABLE;
+		enable = 0;
 	}
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 	return enable;
@@ -392,7 +385,7 @@ static int pch_can_int_pending(struct pch_can_priv *priv)
 }
 
 static void pch_can_set_rx_buffer_link(struct pch_can_priv *priv,
-				       u32 buffer_num, u32 set)
+				       u32 buffer_num, int set)
 {
 	unsigned long flags;
 
@@ -401,7 +394,7 @@ static void pch_can_set_rx_buffer_link(struct pch_can_priv *priv,
 	pch_can_check_if_busy(&priv->regs->ifregs[0].creq, buffer_num);
 	iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL,
 		  &priv->regs->ifregs[0].cmask);
-	if (set == PCH_ENABLE)
+	if (set)
 		pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
 				  PCH_IF_MCONT_EOB);
 	else
@@ -411,27 +404,28 @@ static void pch_can_set_rx_buffer_link(struct pch_can_priv *priv,
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 }
 
-static void pch_can_get_rx_buffer_link(struct pch_can_priv *priv,
-				       u32 buffer_num, u32 *link)
+static u32 pch_can_get_rx_buffer_link(struct pch_can_priv *priv, u32 buffer_num)
 {
 	unsigned long flags;
+	u32 link;
 
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
 	pch_can_check_if_busy(&priv->regs->ifregs[0].creq, buffer_num);
 
 	if (ioread32(&priv->regs->ifregs[0].mcont) & PCH_IF_MCONT_EOB)
-		*link = PCH_DISABLE;
+		link = 0;
 	else
-		*link = PCH_ENABLE;
+		link = 1;
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
+	return link;
 }
 
 static void pch_can_clear_buffers(struct pch_can_priv *priv)
 {
 	int i;
 
-	for (i = 0; i < PCH_RX_OBJ_NUM; i++) {
+	for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
 		iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->ifregs[0].cmask);
 		iowrite32(0xffff, &priv->regs->ifregs[0].mask1);
 		iowrite32(0xffff, &priv->regs->ifregs[0].mask2);
@@ -445,10 +439,10 @@ static void pch_can_clear_buffers(struct pch_can_priv *priv)
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
 			  PCH_CMASK_ARB | PCH_CMASK_CTRL,
 			  &priv->regs->ifregs[0].cmask);
-		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i+1);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i);
 	}
 
-	for (i = i;  i < PCH_OBJ_NUM; i++) {
+	for (i = PCH_TX_OBJ_START;  i <= PCH_TX_OBJ_END; i++) {
 		iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->ifregs[1].cmask);
 		iowrite32(0xffff, &priv->regs->ifregs[1].mask1);
 		iowrite32(0xffff, &priv->regs->ifregs[1].mask2);
@@ -462,7 +456,7 @@ static void pch_can_clear_buffers(struct pch_can_priv *priv)
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
 			  PCH_CMASK_ARB | PCH_CMASK_CTRL,
 			  &priv->regs->ifregs[1].cmask);
-		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i+1);
+		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i);
 	}
 }
 
@@ -473,64 +467,62 @@ static void pch_can_config_rx_tx_buffers(struct pch_can_priv *priv)
 
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX) {
-			iowrite32(PCH_CMASK_RX_TX_GET,
-				&priv->regs->ifregs[0].cmask);
-			pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i+1);
+	for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
+		iowrite32(PCH_CMASK_RX_TX_GET,
+			&priv->regs->ifregs[0].cmask);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i);
 
-			iowrite32(0x0, &priv->regs->ifregs[0].id1);
-			iowrite32(0x0, &priv->regs->ifregs[0].id2);
+		iowrite32(0x0, &priv->regs->ifregs[0].id1);
+		iowrite32(0x0, &priv->regs->ifregs[0].id2);
 
-			pch_can_bit_set(&priv->regs->ifregs[0].mcont,
-					PCH_IF_MCONT_UMASK);
+		pch_can_bit_set(&priv->regs->ifregs[0].mcont,
+				PCH_IF_MCONT_UMASK);
 
-			/* Set FIFO mode set to 0 except last Rx Obj*/
-			pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
+		/* Set FIFO mode set to 0 except last Rx Obj*/
+		pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
+				  PCH_IF_MCONT_EOB);
+		/* In case FIFO mode, Last EoB of Rx Obj must be 1 */
+		if (i == PCH_RX_OBJ_END)
+			pch_can_bit_set(&priv->regs->ifregs[0].mcont,
 					  PCH_IF_MCONT_EOB);
-			/* In case FIFO mode, Last EoB of Rx Obj must be 1 */
-			if (i == (PCH_RX_OBJ_NUM - 1))
-				pch_can_bit_set(&priv->regs->ifregs[0].mcont,
-						  PCH_IF_MCONT_EOB);
-
-			iowrite32(0, &priv->regs->ifregs[0].mask1);
-			pch_can_bit_clear(&priv->regs->ifregs[0].mask2,
-					  0x1fff | PCH_MASK2_MDIR_MXTD);
-
-			/* Setting CMASK for writing */
-			iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
-				  PCH_CMASK_ARB | PCH_CMASK_CTRL,
-				  &priv->regs->ifregs[0].cmask);
 
-			pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i+1);
-		} else if (priv->msg_obj[i] == PCH_MSG_OBJ_TX) {
-			iowrite32(PCH_CMASK_RX_TX_GET,
-				&priv->regs->ifregs[1].cmask);
-			pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i+1);
+		iowrite32(0, &priv->regs->ifregs[0].mask1);
+		pch_can_bit_clear(&priv->regs->ifregs[0].mask2,
+				  0x1fff | PCH_MASK2_MDIR_MXTD);
+
+		/* Setting CMASK for writing */
+		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
+			  PCH_CMASK_ARB | PCH_CMASK_CTRL,
+			  &priv->regs->ifregs[0].cmask);
 
-			/* Resetting DIR bit for reception */
-			iowrite32(0x0, &priv->regs->ifregs[1].id1);
-			iowrite32(0x0, &priv->regs->ifregs[1].id2);
-			pch_can_bit_set(&priv->regs->ifregs[1].id2,
-					PCH_ID2_DIR);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, i);
+	}
 
-			/* Setting EOB bit for transmitter */
-			iowrite32(PCH_IF_MCONT_EOB,
-				  &priv->regs->ifregs[1].mcont);
+	for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) {
+		iowrite32(PCH_CMASK_RX_TX_GET,
+			&priv->regs->ifregs[1].cmask);
+		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i);
 
-			pch_can_bit_set(&priv->regs->ifregs[1].mcont,
-					PCH_IF_MCONT_UMASK);
+		/* Resetting DIR bit for reception */
+		iowrite32(0x0, &priv->regs->ifregs[1].id1);
+		iowrite32(0x0, &priv->regs->ifregs[1].id2);
+		pch_can_bit_set(&priv->regs->ifregs[1].id2, PCH_ID2_DIR);
 
-			iowrite32(0, &priv->regs->ifregs[1].mask1);
-			pch_can_bit_clear(&priv->regs->ifregs[1].mask2, 0x1fff);
+		/* Setting EOB bit for transmitter */
+		iowrite32(PCH_IF_MCONT_EOB, &priv->regs->ifregs[1].mcont);
 
-			/* Setting CMASK for writing */
-			iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
-				  PCH_CMASK_ARB | PCH_CMASK_CTRL,
-				  &priv->regs->ifregs[1].cmask);
+		pch_can_bit_set(&priv->regs->ifregs[1].mcont,
+				PCH_IF_MCONT_UMASK);
 
-			pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i+1);
-		}
+		iowrite32(0, &priv->regs->ifregs[1].mask1);
+		pch_can_bit_clear(&priv->regs->ifregs[1].mask2, 0x1fff);
+
+		/* Setting CMASK for writing */
+		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
+			  PCH_CMASK_ARB | PCH_CMASK_CTRL,
+			  &priv->regs->ifregs[1].cmask);
+
+		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, i);
 	}
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 }
@@ -574,7 +566,20 @@ static void pch_can_int_clr(struct pch_can_priv *priv, u32 mask)
 	}
 
 	/* Clear interrupt for transmit object */
-	if (priv->msg_obj[mask - 1] == PCH_MSG_OBJ_TX) {
+	if ((mask >= PCH_RX_OBJ_START) && (mask <= PCH_RX_OBJ_END)) {
+		/* Setting CMASK for clearing the reception interrupts. */
+		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
+			  &priv->regs->ifregs[0].cmask);
+
+		/* Clearing the Dir bit. */
+		pch_can_bit_clear(&priv->regs->ifregs[0].id2, PCH_ID2_DIR);
+
+		/* Clearing NewDat & IntPnd */
+		pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
+				  PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND);
+
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, mask);
+	} else if ((mask >= PCH_TX_OBJ_START) && (mask <= PCH_TX_OBJ_END)) {
 		/* Setting CMASK for clearing interrupts for
 					 frame transmission. */
 		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
@@ -590,19 +595,6 @@ static void pch_can_int_clr(struct pch_can_priv *priv, u32 mask)
 				  PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND |
 				  PCH_IF_MCONT_TXRQXT);
 		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, mask);
-	} else if (priv->msg_obj[mask - 1] == PCH_MSG_OBJ_RX) {
-		/* Setting CMASK for clearing the reception interrupts. */
-		iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
-			  &priv->regs->ifregs[0].cmask);
-
-		/* Clearing the Dir bit. */
-		pch_can_bit_clear(&priv->regs->ifregs[0].id2, PCH_ID2_DIR);
-
-		/* Clearing NewDat & IntPnd */
-		pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
-				  PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND);
-
-		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, mask);
 	}
 }
 
@@ -790,8 +782,8 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
 			cf->can_dlc = 0;
 			cf->can_id |= CAN_RTR_FLAG;
 		} else {
-			cf->can_dlc = ((ioread32(&priv->regs->ifregs[0].mcont))
-						 & 0x0f);
+			cf->can_dlc =
+			      ((ioread32(&priv->regs->ifregs[0].mcont)) & 0x0f);
 		}
 
 		for (i = 0, j = 0; i < cf->can_dlc; j++) {
@@ -829,7 +821,7 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
 RX_NEXT:
 		/* Reading the messsage object from the Message RAM */
 		iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
-		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, k + 1);
+		pch_can_check_if_busy(&priv->regs->ifregs[0].creq, k);
 		reg = ioread32(&priv->regs->ifregs[0].mcont);
 	}
 
@@ -877,29 +869,27 @@ INT_STAT:
 	}
 
 MSG_OBJ:
-	if ((int_stat >= 1) && (int_stat <= PCH_RX_OBJ_NUM)) {
+	if ((int_stat >= PCH_RX_OBJ_START) && (int_stat <= PCH_RX_OBJ_END)) {
 		spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 		rcv_pkts = pch_can_rx_normal(ndev, int_stat);
 		spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 		if (rcv_pkts < 0)
 			return 0;
-	} else if ((int_stat > PCH_RX_OBJ_NUM) && (int_stat <= PCH_OBJ_NUM)) {
-		if (priv->msg_obj[int_stat - 1] == PCH_MSG_OBJ_TX) {
-			/* Handle transmission interrupt */
-			can_get_echo_skb(ndev, int_stat - PCH_RX_OBJ_NUM - 1);
-			spin_lock_irqsave(&priv->msgif_reg_lock, flags);
-			iowrite32(PCH_CMASK_RX_TX_GET | PCH_CMASK_CLRINTPND,
-				  &priv->regs->ifregs[1].cmask);
-			dlc = ioread32(&priv->regs->ifregs[1].mcont) &
-				       PCH_IF_MCONT_DLC;
-			pch_can_check_if_busy(&priv->regs->ifregs[1].creq,
-					      int_stat);
-			spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
-			if (dlc > 8)
-				dlc = 8;
-			stats->tx_bytes += dlc;
-			stats->tx_packets++;
-		}
+	} else if ((int_stat >= PCH_TX_OBJ_START) &&
+		   (int_stat <= PCH_TX_OBJ_END)) {
+		/* Handle transmission interrupt */
+		can_get_echo_skb(ndev, int_stat - PCH_RX_OBJ_END - 1);
+		spin_lock_irqsave(&priv->msgif_reg_lock, flags);
+		iowrite32(PCH_CMASK_RX_TX_GET | PCH_CMASK_CLRINTPND,
+			  &priv->regs->ifregs[1].cmask);
+		dlc = ioread32(&priv->regs->ifregs[1].mcont) &
+			       PCH_IF_MCONT_DLC;
+		pch_can_check_if_busy(&priv->regs->ifregs[1].creq, int_stat);
+		spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
+		if (dlc > 8)
+			dlc = 8;
+		stats->tx_bytes += dlc;
+		stats->tx_packets++;
 	}
 
 	int_stat = pch_can_int_pending(priv);
@@ -1061,12 +1051,12 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
 	if (can_dropped_invalid_skb(ndev, skb))
 		return NETDEV_TX_OK;
 
-	if (priv->tx_obj == (PCH_OBJ_NUM + 1)) { /* Point tail Obj */
+	if (priv->tx_obj == PCH_TX_OBJ_END) { /* Point tail Obj */
 		while (pch_get_msg_obj_sts(ndev, (((1 << PCH_TX_OBJ_NUM)-1) <<
 					   PCH_RX_OBJ_NUM)))
 			udelay(500);
 
-		priv->tx_obj = PCH_RX_OBJ_NUM + 1; /* Point head of Tx Obj ID */
+		priv->tx_obj = PCH_TX_OBJ_START; /* Point head of Tx Obj ID */
 		tx_buffer_avail = priv->tx_obj; /* Point Tail of Tx Obj */
 	} else {
 		tx_buffer_avail = priv->tx_obj;
@@ -1110,7 +1100,7 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
 			 (&priv->regs->ifregs[1].dataa1) + j*4);
 	}
 
-	can_put_echo_skb(skb, ndev, tx_buffer_avail - PCH_RX_OBJ_NUM - 1);
+	can_put_echo_skb(skb, ndev, tx_buffer_avail - PCH_RX_OBJ_END - 1);
 
 	/* Updating the size of the data. */
 	pch_can_bit_clear(&priv->regs->ifregs[1].mcont, 0x0f);
@@ -1185,23 +1175,16 @@ static int pch_can_suspend(struct pci_dev *pdev, pm_message_t state)
 	pch_can_set_int_enables(priv, PCH_CAN_DISABLE);
 
 	/* Save Tx buffer enable state */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
-			priv->tx_enable[i] = pch_can_get_rxtx_ir(priv, i + 1,
-								 PCH_TX_IFREG);
-	}
+	for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
+		priv->tx_enable[i] = pch_can_get_rxtx_ir(priv, i, PCH_TX_IFREG);
 
 	/* Disable all Transmit buffers */
 	pch_can_set_tx_all(priv, 0);
 
 	/* Save Rx buffer enable state */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX) {
-			priv->rx_enable[i] = pch_can_get_rxtx_ir(priv, i + 1,
-						PCH_RX_IFREG);
-			pch_can_get_rx_buffer_link(priv, i + 1,
-						&(priv->rx_link[i]));
-		}
+	for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
+		priv->rx_enable[i] = pch_can_get_rxtx_ir(priv, i, PCH_RX_IFREG);
+		priv->rx_link[i] = pch_can_get_rx_buffer_link(priv, i);
 	}
 
 	/* Disable all Receive buffers */
@@ -1253,24 +1236,16 @@ static int pch_can_resume(struct pci_dev *pdev)
 	pch_can_set_optmode(priv);
 
 	/* Enabling the transmit buffer. */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_TX)
-			pch_can_set_rxtx(priv, i, priv->tx_enable[i],
-					 PCH_TX_IFREG);
-	}
+	for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
+		pch_can_set_rxtx(priv, i, priv->tx_enable[i], PCH_TX_IFREG);
 
 	/* Configuring the receive buffer and enabling them. */
-	for (i = 0; i < PCH_OBJ_NUM; i++) {
-		if (priv->msg_obj[i] == PCH_MSG_OBJ_RX) {
-			/* Restore buffer link */
-			pch_can_set_rx_buffer_link(priv, i + 1,
-						   priv->rx_link[i]);
+	for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
+		/* Restore buffer link */
+		pch_can_set_rx_buffer_link(priv, i, priv->rx_link[i]);
 
-			/* Restore buffer enables */
-			pch_can_set_rxtx(priv, i, priv->rx_enable[i],
-					 PCH_RX_IFREG);
-
-		}
+		/* Restore buffer enables */
+		pch_can_set_rxtx(priv, i, priv->rx_enable[i], PCH_RX_IFREG);
 	}
 
 	/* Enable CAN Interrupts */
@@ -1303,7 +1278,6 @@ static int __devinit pch_can_probe(struct pci_dev *pdev,
 	struct net_device *ndev;
 	struct pch_can_priv *priv;
 	int rc;
-	int index;
 	void __iomem *addr;
 
 	rc = pci_enable_device(pdev);
@@ -1325,7 +1299,7 @@ static int __devinit pch_can_probe(struct pci_dev *pdev,
 		goto probe_exit_ipmap;
 	}
 
-	ndev = alloc_candev(sizeof(struct pch_can_priv), PCH_TX_OBJ_NUM);
+	ndev = alloc_candev(sizeof(struct pch_can_priv), PCH_TX_OBJ_END);
 	if (!ndev) {
 		rc = -ENOMEM;
 		dev_err(&pdev->dev, "Failed alloc_candev\n");
@@ -1341,7 +1315,7 @@ static int __devinit pch_can_probe(struct pci_dev *pdev,
 	priv->can.do_get_berr_counter = pch_can_get_berr_counter;
 	priv->can.ctrlmode_supported = CAN_CTRLMODE_LISTENONLY |
 				       CAN_CTRLMODE_LOOPBACK;
-	priv->tx_obj = PCH_RX_OBJ_NUM + 1; /* Point head of Tx Obj */
+	priv->tx_obj = PCH_TX_OBJ_START; /* Point head of Tx Obj */
 
 	ndev->irq = pdev->irq;
 	ndev->flags |= IFF_ECHO;
@@ -1349,15 +1323,9 @@ static int __devinit pch_can_probe(struct pci_dev *pdev,
 	pci_set_drvdata(pdev, ndev);
 	SET_NETDEV_DEV(ndev, &pdev->dev);
 	ndev->netdev_ops = &pch_can_netdev_ops;
-
 	priv->can.clock.freq = PCH_CAN_CLK; /* Hz */
-	for (index = 0; index < PCH_RX_OBJ_NUM;)
-		priv->msg_obj[index++] = PCH_MSG_OBJ_RX;
-
-	for (index = index;  index < PCH_OBJ_NUM;)
-		priv->msg_obj[index++] = PCH_MSG_OBJ_TX;
 
-	netif_napi_add(ndev, &priv->napi, pch_can_rx_poll, PCH_RX_OBJ_NUM);
+	netif_napi_add(ndev, &priv->napi, pch_can_rx_poll, PCH_RX_OBJ_END);
 
 	rc = register_candev(ndev);
 	if (rc) {
-- 
1.6.0.6


^ permalink raw reply related

* [PATCH net-next-2.6 3/17] can: EG20T PCH: Enumerate some macros
From: Tomoya MORINAGA @ 2010-11-19  5:44 UTC (permalink / raw)
  To: Wolfgang Grandegger, Wolfram Sang, Christian Pellegrin,
	Barry Song, Samuel Ortiz
  Cc: qi.wang, yong.y.wang, andrew.chih.howe.khor, joel.clark,
	kok.howg.ewe, margie.foster

For easy to readable, LEC and interface register number macros are replaced to enums.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
---
 drivers/net/can/pch_can.c |   90 +++++++++++++++++++++++++--------------------
 1 files changed, 50 insertions(+), 40 deletions(-)

diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index b028ae4..5c21f5c 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -69,21 +69,12 @@
 #define PCH_REC			0x00007f00
 #define PCH_TEC			0x000000ff
 
+
 #define PCH_TX_OK		BIT(3)
 #define PCH_RX_OK		BIT(4)
 #define PCH_EPASSIV		BIT(5)
 #define PCH_EWARN		BIT(6)
 #define PCH_BUS_OFF		BIT(7)
-#define PCH_LEC0		BIT(0)
-#define PCH_LEC1		BIT(1)
-#define PCH_LEC2		BIT(2)
-#define PCH_LEC_ALL		(PCH_LEC0 | PCH_LEC1 | PCH_LEC2)
-#define PCH_STUF_ERR		PCH_LEC0
-#define PCH_FORM_ERR		PCH_LEC1
-#define PCH_ACK_ERR		(PCH_LEC0 | PCH_LEC1)
-#define PCH_BIT1_ERR		PCH_LEC2
-#define PCH_BIT0_ERR		(PCH_LEC0 | PCH_LEC2)
-#define PCH_CRC_ERR		(PCH_LEC1 | PCH_LEC2)
 
 /* bit position of certain controller bits. */
 #define PCH_BIT_BRP		0
@@ -96,9 +87,6 @@
 #define PCH_MSK_CTRL_IE_SIE_EIE	0x07
 #define PCH_COUNTER_LIMIT	10
 
-#define PCH_RX_IFREG			0
-#define PCH_TX_IFREG			1
-
 #define PCH_CAN_CLK		50000000	/* 50MHz */
 
 /* Define the number of message object.
@@ -113,6 +101,21 @@
 
 #define PCH_FIFO_THRESH		16
 
+enum pch_ifreg {
+	PCH_RX_IFREG,
+	PCH_TX_IFREG,
+};
+
+enum pch_can_err {
+	PCH_STUF_ERR = 1,
+	PCH_FORM_ERR,
+	PCH_ACK_ERR,
+	PCH_BIT1_ERR,
+	PCH_BIT0_ERR,
+	PCH_CRC_ERR,
+	PCH_LEC_ALL,
+};
+
 enum pch_can_mode {
 	PCH_CAN_ENABLE,
 	PCH_CAN_DISABLE,
@@ -302,7 +305,7 @@ static void pch_can_check_if_busy(u32 __iomem *creq_addr, u32 num)
 }
 
 static void pch_can_set_rxtx(struct pch_can_priv *priv, u32 buff_num,
-				  int set, u32 dir)
+			     int set, enum pch_ifreg dir)
 {
 	unsigned long flags;
 	u32 ie;
@@ -616,7 +619,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
 	struct sk_buff *skb;
 	struct pch_can_priv *priv = netdev_priv(ndev);
 	struct can_frame *cf;
-	u32 errc;
+	u32 errc, lec;
 	struct net_device_stats *stats = &(priv->ndev->stats);
 	enum can_state state = priv->can.state;
 
@@ -661,35 +664,42 @@ static void pch_can_error(struct net_device *ndev, u32 status)
 			"%s -> CAN controller is ERROR PASSIVE .\n", __func__);
 	}
 
-	if (status & PCH_LEC_ALL) {
+	lec = status & PCH_LEC_ALL;
+	switch (lec) {
+	case PCH_STUF_ERR:
+		cf->data[2] |= CAN_ERR_PROT_STUFF;
 		priv->can.can_stats.bus_error++;
 		stats->rx_errors++;
-		switch (status & PCH_LEC_ALL) {
-		case PCH_STUF_ERR:
-			cf->data[2] |= CAN_ERR_PROT_STUFF;
-			break;
-		case PCH_FORM_ERR:
-			cf->data[2] |= CAN_ERR_PROT_FORM;
-			break;
-		case PCH_ACK_ERR:
-			cf->data[2] |= CAN_ERR_PROT_LOC_ACK |
-				       CAN_ERR_PROT_LOC_ACK_DEL;
-			break;
-		case PCH_BIT1_ERR:
-		case PCH_BIT0_ERR:
-			cf->data[2] |= CAN_ERR_PROT_BIT;
-			break;
-		case PCH_CRC_ERR:
-			cf->data[2] |= CAN_ERR_PROT_LOC_CRC_SEQ |
-				       CAN_ERR_PROT_LOC_CRC_DEL;
-			break;
-		default:
-			iowrite32(status | PCH_LEC_ALL, &priv->regs->stat);
-			break;
-		}
-
+		break;
+	case PCH_FORM_ERR:
+		cf->data[2] |= CAN_ERR_PROT_FORM;
+		priv->can.can_stats.bus_error++;
+		stats->rx_errors++;
+		break;
+	case PCH_ACK_ERR:
+		cf->can_id |= CAN_ERR_ACK;
+		priv->can.can_stats.bus_error++;
+		stats->rx_errors++;
+		break;
+	case PCH_BIT1_ERR:
+	case PCH_BIT0_ERR:
+		cf->data[2] |= CAN_ERR_PROT_BIT;
+		priv->can.can_stats.bus_error++;
+		stats->rx_errors++;
+		break;
+	case PCH_CRC_ERR:
+		cf->data[2] |= CAN_ERR_PROT_LOC_CRC_SEQ |
+			       CAN_ERR_PROT_LOC_CRC_DEL;
+		priv->can.can_stats.bus_error++;
+		stats->rx_errors++;
+		break;
+	case PCH_LEC_ALL: /* Written by CPU. No error status */
+		break;
 	}
 
+	cf->data[6] = errc & PCH_TEC;
+	cf->data[7] = (errc & PCH_REC) >> 8;
+
 	priv->can.state = state;
 	netif_rx(skb);
 
-- 
1.6.0.6


^ permalink raw reply related

* [PATCH net-next-2.6 4/17] can: EG20T PCH: Add Tx Flow Control
From: Tomoya MORINAGA @ 2010-11-19  5:45 UTC (permalink / raw)
  To: Wolfgang Grandegger, Wolfram Sang, Christian Pellegrin,
	Barry Song, Samuel Ortiz
  Cc: qi.wang, yong.y.wang, andrew.chih.howe.khor, joel.clark,
	kok.howg.ewe, margie.foster

Add flow control processing.
Currently, there is no flow control processing.
Thus, Add flow control processing as
when there is no empty of tx buffer,
netif_stop_queue is called.
When there is empty buffer, netif_wake_queue is called.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
---
 drivers/net/can/pch_can.c |   37 +++++++++++++------------------------
 1 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index 5c21f5c..7c182b8 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -900,6 +900,8 @@ MSG_OBJ:
 			dlc = 8;
 		stats->tx_bytes += dlc;
 		stats->tx_packets++;
+		if (int_stat == PCH_TX_OBJ_END)
+			netif_wake_queue(ndev);
 	}
 
 	int_stat = pch_can_int_pending(priv);
@@ -1038,47 +1040,34 @@ static int pch_close(struct net_device *ndev)
 	return 0;
 }
 
-static int pch_get_msg_obj_sts(struct net_device *ndev, u32 obj_id)
-{
-	u32 buffer_status = 0;
-	struct pch_can_priv *priv = netdev_priv(ndev);
-
-	/* Getting the message object status. */
-	buffer_status = (u32) pch_can_get_buffer_status(priv);
-
-	return buffer_status & obj_id;
-}
-
-
 static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	int i, j;
 	unsigned long flags;
 	struct pch_can_priv *priv = netdev_priv(ndev);
 	struct can_frame *cf = (struct can_frame *)skb->data;
-	int tx_buffer_avail = 0;
+	int tx_obj_no = 0;
 
 	if (can_dropped_invalid_skb(ndev, skb))
 		return NETDEV_TX_OK;
 
-	if (priv->tx_obj == PCH_TX_OBJ_END) { /* Point tail Obj */
-		while (pch_get_msg_obj_sts(ndev, (((1 << PCH_TX_OBJ_NUM)-1) <<
-					   PCH_RX_OBJ_NUM)))
-			udelay(500);
+	if (priv->tx_obj == PCH_TX_OBJ_END) {
+		if (ioread32(&priv->regs->treq2) & 0xfc00)
+			netif_stop_queue(ndev);
 
-		priv->tx_obj = PCH_TX_OBJ_START; /* Point head of Tx Obj ID */
-		tx_buffer_avail = priv->tx_obj; /* Point Tail of Tx Obj */
+		tx_obj_no = priv->tx_obj;
+		priv->tx_obj = PCH_TX_OBJ_START;
 	} else {
-		tx_buffer_avail = priv->tx_obj;
+		tx_obj_no = priv->tx_obj;
+		priv->tx_obj++;
 	}
-	priv->tx_obj++;
 
 	/* Attaining the lock. */
 	spin_lock_irqsave(&priv->msgif_reg_lock, flags);
 
 	/* Reading the Msg Obj from the Msg RAM to the Interface register. */
 	iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[1].cmask);
-	pch_can_check_if_busy(&priv->regs->ifregs[1].creq, tx_buffer_avail);
+	pch_can_check_if_busy(&priv->regs->ifregs[1].creq, tx_obj_no);
 
 	/* Setting the CMASK register. */
 	pch_can_bit_set(&priv->regs->ifregs[1].cmask, PCH_CMASK_ALL);
@@ -1110,7 +1099,7 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
 			 (&priv->regs->ifregs[1].dataa1) + j*4);
 	}
 
-	can_put_echo_skb(skb, ndev, tx_buffer_avail - PCH_RX_OBJ_END - 1);
+	can_put_echo_skb(skb, ndev, tx_obj_no - PCH_RX_OBJ_END - 1);
 
 	/* Updating the size of the data. */
 	pch_can_bit_clear(&priv->regs->ifregs[1].mcont, 0x0f);
@@ -1125,7 +1114,7 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
 	pch_can_bit_set(&priv->regs->ifregs[1].mcont,
 			PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_TXRQXT);
 
-	pch_can_check_if_busy(&priv->regs->ifregs[1].creq, tx_buffer_avail);
+	pch_can_check_if_busy(&priv->regs->ifregs[1].creq, tx_obj_no);
 
 	spin_unlock_irqrestore(&priv->msgif_reg_lock, flags);
 
-- 
1.6.0.6


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox