All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: cg-mkpatch use case
From: Petr Baudis @ 2006-05-02 21:57 UTC (permalink / raw)
  To: Belmar-Letelier; +Cc: git
In-Reply-To: <44570E8E.5070402@itaapy.com>

  Hi,

Dear diary, on Tue, May 02, 2006 at 09:47:26AM CEST, I got a letter
where Belmar-Letelier <luis@itaapy.com> said that...
> I have 3 questions about cg-mkpatch
> 
> 1. I've receive a file "xxx.patch", this content came from
>   cg-mkpatch, but I can't apply it.
>   For example if I try git-am I get::
> 
>     $ git-am --signoff xxx.patch
>     Patch does not have a valid e-mail address.
> 
>   What is the Cogito way to apply the result of "cg-mkpatch"

  cg-mkpatch is a very old tool which has been long neglected and
not many people actually use it nowadays, I believe. You can apply it
back using cg-patch (or even patch itself, or git-apply if you are
lucky), but it won't automagically extract the commit message and
authorship information.

> 2. What are the difference between usecases with "cg-mkpatch"
>   and "git-format-patch" ?

  git-format-patch outputs stuff in the mailbox format while cg-mkpatch
outputs it in a more "human readable" (well, but quite historical)
format, but really, you probably want to use git-format-patch in almost
every case. In the (probably relatively near) future, cg-mkpatch might
become merely a git-format-patch wrapper.

> 3. It seem that if a commit as a binary file they are no way to manage
>   it by email patches. Any plan about this in Cogito ?

  Not any clear plans. I will welcome patches but it is not high
priority for me currently.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.

^ permalink raw reply

* Re: [PATCH] built-in "git grep" (git grip).
From: Junio C Hamano @ 2006-05-02 21:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0605021422200.4086@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> On Tue, 2 May 2006, Junio C Hamano wrote:
>> 
>>  - The shell-script one, if you use GNU grep, accepts more
>>    options to grep than what the current built-in one supports.
>>    Notable ones that are missing: fixed strings (-F), patterns
>>    from file (-f), count matches (-c), omit filenames (-h),
>>    skipping binary files (-I, -U), files without match (-L),
>>    pcre (-P), silent (-q), word expression (-w), NUL (-z).  They
>>    should be easy to add if somebody cares enough, and I plan to
>>    do a few myself before pushing it out to "master".
>
> I use "-w" all the time, along with -5 or similar to get context for the 
> grep.

Noted; -w is missing; -A/-B/-C are already there so you could
say -C 5 instead, and -<n> should be easy to add.

On a related tangent, ever since I started using the built-in
grep with ls-files like wildcard, I find myself typing something
like this by mistake (this is from my day-job work project that
has src/mx.js and src/mxstyle.css among other things):

	git diff 268a94 -- 'src/mx*'

I am tempted to suggest switching pathspecs used by diff and log
family to do the same wildcarding, perhaps after tightening the
wildcard vs directory prefix logic used in the builtin-grep of
the current "next" tip, which is a bit looser than necessary.

^ permalink raw reply

* [RFC] Advanced XIP File System
From: Jared Hulbert @ 2006-05-02 21:53 UTC (permalink / raw)
  To: linux-kernel

I will be submitting a new filesystem for inclusion into the kernel as
soon as it is ready.  (It mounts but doesn't like doing much else
right now.)  I would like to get feedback now to mold the development
as we go along.  Please comment on the technical approaches and other
inherent qualities or lack thereof.  Let me know of any serious
obstacles to inclusion in the mainline.  We will Lindent it and clean
it up quite a bit before really submitting.

You may find it at its very boring sourceforge site
https://sourceforge.net/projects/axfs/.  Browse the source at 
http://svn.sourceforge.net/axfs
Or get the tarball at 
http://prdownloads.sourceforge.net/axfs/axfs-0.1.tar.gz?download


What is it?:
- AXFS for Advanced XIP File System.
- Intended to be a root filesystem for embedded systems
- Readonly
- Uses addressable memory such as NOR flash instead of a block device
- Borrows much from CRAMFS with Linear XIP patches
- Allows XIP* of individual pages instead of just individual files
- Uses filemap_xip.c where possible

* By XIP, eXecute In Place, we mean that when a file is mmap'd() the
pages are mapped directly to where they are stored in non volatile
storage, rather than copied to RAM in the page cache and mapped from
there


Why a new filesystem?
- XIP of kernel is mainline, but not XIP of applications.  This
enables application XIP
- Cramfs linear XIP patches not suitable for submission and lack some
features of AXFS
- Design allows for tighter packing of data and higher performance
than XIP cramfs


(Warning - Long explaination of why XIP support is important follows. 
Please read before flaming XIP.)

I've heard people say, "XIP is stupid.  Why on earth would I use
expensive slow flash instead of cheap fast RAM?"  Let me try explain
why it can be smart and why it is actually done in practice.  In fact
many of the mobile handsets that run Linux use XIP CRAMFS today.  If I
take libfoo.so which is about 2MiB and throw it in JFFS2, it
compresses to about 1MiB in flash.  If I store libfoo.so as an XIP
file (uncompressed) in XIP CRAMFS or AXFS it takes up 2MiB of flash. 
That is 1MiB extra flash for XIP.  But the JFFS2 version would need
2MiB of RAM to store that library when used while the XIP system uses
0MiB.  That means XIP uses +1MiB of flash and -2MiB of RAM for
libfoo.so.  So for any extra flash used for XIP, it can save twice
that amount of RAM.  The end result can be lower cost systems on the
small end.  The secret is to choose what to make XIP and what to
compress on flash.

XIP can also increase performance.  Processor caches make the slower
read speed, compared to RAM, of a NOR type flash often used for XIP
not important.  However when an application 'bar' gets started and the
code is mmap()'ed into the process the XIP system creates page table
entries pointing to a physical address for all the code the process
needs.  Without XIP, as I understand it, basically empty page tables
are created.  As code is executed the system page faults and code is
fetched from the filesystem, for example JFFS2, in a rather long
process of copying to RAM, decompressing, and transfering to
userspace.  And of course this happens, interrupting execution of
'bar', every time you access a new page of code.  To misquote Linus
"bow down before me, you scum" Torvalds, "That cost is _bigger_ than
the cost of just copying the page in the first place."  Code that is
XIP takes that a step farther, it _never_  faults and _never_ gets
copied.

To revisit the libfoo.so story lets say that the often used
application 'bar' only calls one function in libfoo and therefore only
pages in 1MiB of libfoo into RAM.  Does this break the XIP argument?
(+1MB Flash for -1MB RAM)  Not with AXFS!  A system designer could
then choose to only XIP the specific pages within libfoo.so that are
actually accessed.  In that way the 2:1 ratio is retained.  The AXFS
effort will include some tools to help identify which pages do what,
to help system designers optimize thier systems for memory usage.

^ permalink raw reply

* Re: Add a "enable" sysfs attribute to the pci devices to allow userspace (Xorg) to enable devices without doing foul direct access
From: Jon Smirl @ 2006-05-02 21:52 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Arjan van de Ven, greg, linux-pci, linux-kernel, airlied, pjones,
	akpm
In-Reply-To: <21d7e9970605021440s6cdc3895t57617e5fad6c5050@mail.gmail.com>

On 5/2/06, Dave Airlie <airlied@gmail.com> wrote:
> Jon stop being so dramatic, this is just like letting userspace map
> the BARs, without ownership through sysfs, which is a good thing, you
> can still map /dev/mem, look we have lots of ways to shoot ourselves
> in the foot, if we *want* to.

So why don't we just build a VGA class driver or make null fbdev
drivers? That solution works and stays in the model of one driver per
device and user space using a device driver to control the hardware.
This is a known problem and we have a valid solution, why build a new
API perpetuating the old model? If there wasn't a workable alternative
available I wouldn't be complaining.

Have you seen this method of getting root from X?
http://www.cansecwest.com/slides06/csw06-duflot.ppt
It is referenced from Theo de Raadt interview on kerneltrap
http://kerneltrap.org/node/6550

I am happy to see progress being made at getting X out of the PCI bus business.

--
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: [PATCH] s390: Hypervisor File System
From: Kay Sievers @ 2006-05-02 21:49 UTC (permalink / raw)
  To: Greg KH
  Cc: Kyle Moffett, Michael Holzheu, akpm, schwidefsky, penberg,
	ioe-lkml, joern, linux-kernel
In-Reply-To: <20060502213043.GB30957@kroah.com>

On Tue, May 02, 2006 at 02:30:43PM -0700, Greg KH wrote:
> On Tue, May 02, 2006 at 04:48:42AM -0400, Kyle Moffett wrote:
> > On May 2, 2006, at 00:00:53, Greg KH wrote:
> > >On Mon, May 01, 2006 at 07:29:23PM -0400, Kyle Moffett wrote:
> > >>So my question stands:  What is the _recommended_ way to handle  
> > >>simple data types in low-bandwidth/frequency multiple-valued  
> > >>transactions to hardware?  Examples include reading/modifying  
> > >>framebuffer settings (currently done through IOCTLS), s390 current  
> > >>state (up for discussion), etc.  In these cases there needs to be  
> > >>an atomic snapshot or write of multiple values at the same time.   
> > >>Given the situation it would be _nice_ to use sysfs so the admin  
> > >>can do it by hand; makes things shell scriptable and reduces the  
> > >>number of binary compatibility issues.
> > >
> > >I really don't know of a way to use sysfs for this currently, and  
> > >hence, am not complaining too much about the different /proc files  
> > >that have this kind of information in it at the moment.
> > >
> > >If you or someone else wants to come up with some kind of solution  
> > >for it, I'm sure that many people would be very happy to see it.
> > 
> > Hmm, ok; I'll see what I can come up with.  Would anybody object to  
> > this kind of API (as in my previous email) that uses an open fd as a  
> > transaction "handle"?
> 
> No, I think Kay played around with something like using the open fd of
> the directory as such a lock (or was he using flock on it, I can't
> remember now...)

If you can assume that processes accessing the values are cooperative,
it already works without any changes:

  $ time flock /sys/class/firmware echo 1 > /sys/class/firmware/timeout
  real    0m0.005s

  $ flock /sys/class/firmware sleep 5&
  [1] 6468

  $ time flock /sys/class/firmware echo 1 > /sys/class/firmware/timeout
  real    0m3.558s

Kay

^ permalink raw reply

* Re:
From: Glynn Clements @ 2006-05-02 21:48 UTC (permalink / raw)
  To: Kirkwood, David A; +Cc: linux-admin
In-Reply-To: <954E3479CC27224785179CA04904214D018B6D16@0668-its-exmp01.us.saic.com>


Kirkwood, David A wrote:

> Do I need to enable ip-forwarding for a system to function as an ip
> router or is this enabled automatically by routed? If I do need to
> manually how do I enable it? If not can I disable it though the routed
> or do I just use ipchains / iptables?

It can be controlled with:

	echo 1 > /proc/sys/net/ipv4/ip_forward
or:
	sysctl net.ipv4.ip_forward=1

or, if your system has an /etc/sysctl.conf file, just add:

	net.ipv4.ip_forward=1

Also, do you actually need to run routed? If you aren't sure, the
answer is probably no.

-- 
Glynn Clements <glynn@gclements.plus.com>

^ permalink raw reply

* [PATCH 1/2] ipg: sanitize the pci device table
From: Francois Romieu @ 2006-05-02 21:44 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: David Vrabel, linux-kernel, netdev, david
In-Reply-To: <Pine.LNX.4.58.0605020945010.4066@sbz-30.cs.Helsinki.FI>

- vendor id belong to include/linux/pci_id.h ;
- the pci table does not include all the devices in nics_supported ;
- qualify the pci table as __devinitdata ;
- kill 50 LOC.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

---

 drivers/net/ipg.c       |   46 ++++++--------------------------
 drivers/net/ipg.h       |   67 +++++++++++------------------------------------
 include/linux/pci_ids.h |    2 +
 3 files changed, 27 insertions(+), 88 deletions(-)

aa5b322a6f91ca12a580dfa7022fca1a088b4abd
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 393b617..ea7c1f8 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -32,40 +32,14 @@ MODULE_DESCRIPTION("IC Plus IP1000 Gigab
 		   DrvVer);
 MODULE_LICENSE("GPL");
 
-static struct pci_device_id ipg_pci_tbl[] = {
-	{PCI_VENDOR_ID_ICPLUS,
-	 PCI_DEVICE_ID_IP1000,
-	 PCI_ANY_ID,
-	 PCI_ANY_ID,
-	 0x020000,
-	 0xFFFFFF,
-	 0},
-
-	{PCI_VENDOR_ID_SUNDANCE,
-	 PCI_DEVICE_ID_SUNDANCE_ST2021,
-	 PCI_ANY_ID,
-	 PCI_ANY_ID,
-	 0x020000,
-	 0xFFFFFF,
-	 1},
-
-	{PCI_VENDOR_ID_SUNDANCE,
-	 PCI_DEVICE_ID_TAMARACK_TC9020_9021,
-	 PCI_ANY_ID,
-	 PCI_ANY_ID,
-	 0x020000,
-	 0xFFFFFF,
-	 2},
-
-	{PCI_VENDOR_ID_DLINK,
-	 PCI_DEVICE_ID_DLINK_1002,
-	 PCI_ANY_ID,
-	 PCI_ANY_ID,
-	 0x020000,
-	 0xFFFFFF,
-	 3},
-
-	{0,}
+static struct pci_device_id ipg_pci_tbl[] __devinitdata = {
+	{ PCI_DEVICE(PCI_VENDOR_ID_SUNDANCE,	0x1023), 0, 0, 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SUNDANCE,	0x2021), 0, 0, 1 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SUNDANCE,	0x1021), 0, 0, 2 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x9021), 0, 0, 3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x4000), 0, 0, 4 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x4020), 0, 0, 5 },
+	{ 0, }
 };
 
 MODULE_DEVICE_TABLE(pci, ipg_pci_tbl);
@@ -2961,9 +2935,7 @@ static int __devinit ipg_probe(struct pc
 	if (rc < 0)
 		goto out;
 
-	printk(KERN_INFO "%s found.\n", nics_supported[i].NICname);
-	printk(KERN_INFO "Bus %x Slot %x\n",
-	       pdev->bus->number, PCI_SLOT(pdev->devfn));
+	printk(KERN_INFO "%s: %s\n", pci_name(pdev), nics_supported[i].name);
 
 	pci_set_master(pdev);
 
diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index ae3424a..03bc6f1 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -589,34 +589,6 @@ #define IPG_RI_RXDMAWAIT_TIME           
  *	Tune
  */
 
-#ifndef PCI_VENDOR_ID_ICPLUS
-#  define       PCI_VENDOR_ID_ICPLUS            0x13F0
-#endif
-#ifndef PCI_DEVICE_ID_IP1000
-#  define       PCI_DEVICE_ID_IP1000		    0x1023
-#endif
-#ifndef PCI_VENDOR_ID_SUNDANCE
-#  define       PCI_VENDOR_ID_SUNDANCE          0x13F0
-#endif
-#ifndef PCI_DEVICE_ID_SUNDANCE_IPG
-#  define       PCI_DEVICE_ID_SUNDANCE_ST2021   0x2021
-#endif
-#ifndef PCI_DEVICE_ID_TAMARACK_TC9020_9021_ALT
-#  define       PCI_DEVICE_ID_TAMARACK_TC9020_9021_ALT 0x9021
-#endif
-#ifndef PCI_DEVICE_ID_TAMARACK_TC9020_9021
-#  define       PCI_DEVICE_ID_TAMARACK_TC9020_9021 0x1021
-#endif
-#ifndef PCI_VENDOR_ID_DLINK
-#  define       PCI_VENDOR_ID_DLINK             0x1186
-#endif
-#ifndef PCI_DEVICE_ID_DLINK_1002
-#  define       PCI_DEVICE_ID_DLINK_1002        0x4000
-#endif
-#ifndef PCI_DEVICE_ID_DLINK_IP1000A
-#  define PCI_DEVICE_ID_DLINK_IP1000A		0x4020
-#endif
-
 /* Miscellaneous Constants. */
 #define   TRUE  1
 #define   FALSE 0
@@ -990,32 +962,25 @@ #endif
 };
 
 struct nic_id {
-	char *NICname;
-	int vendorid;
-	int deviceid;
+	char *name;
+	u32 vendor;
+	u32 device;
 };
 
 struct nic_id nics_supported[] = {
-	{"IC PLUS IP1000 1000/100/10 based NIC",
-	 PCI_VENDOR_ID_ICPLUS,
-	 PCI_DEVICE_ID_IP1000},
-	{"Sundance Technology ST2021 based NIC",
-	 PCI_VENDOR_ID_SUNDANCE,
-	 PCI_DEVICE_ID_SUNDANCE_ST2021},
-	{"Tamarack Microelectronics TC9020/9021 based NIC",
-	 PCI_VENDOR_ID_SUNDANCE,
-	 PCI_DEVICE_ID_TAMARACK_TC9020_9021},
-	{"Tamarack Microelectronics TC9020/9021 based NIC",
-	 PCI_VENDOR_ID_SUNDANCE,
-	 PCI_DEVICE_ID_TAMARACK_TC9020_9021_ALT},
-	{"D-Link NIC",
-	 PCI_VENDOR_ID_DLINK,
-	 PCI_DEVICE_ID_DLINK_1002},
-	{"D-Link NIC IP1000A",
-	 PCI_VENDOR_ID_DLINK,
-	 PCI_DEVICE_ID_DLINK_IP1000A},
-
-	{"N/A", 0xFFFF, 0}
+	{ "IC PLUS IP1000 1000/100/10 based NIC",
+		PCI_VENDOR_ID_SUNDANCE,	0x1023 },
+	{ "Sundance Technology ST2021 based NIC",
+		PCI_VENDOR_ID_SUNDANCE,	0x2021 },
+	{ "Tamarack Microelectronics TC9020/9021 based NIC",
+		PCI_VENDOR_ID_SUNDANCE, 0x1021 },
+	{ "Tamarack Microelectronics TC9020/9021 based NIC",
+		PCI_VENDOR_ID_SUNDANCE, 0x9021 },
+	{ "D-Link NIC",
+		PCI_VENDOR_ID_DLINK,	0x4000 },
+	{ "D-Link NIC IP1000A",
+		PCI_VENDOR_ID_DLINK,	0x4020 },
+	{ NULL, 0xffff, 0 }
 };
 
 //variable record -- index by leading revision/length
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d6fe048..b772f2b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1788,6 +1788,8 @@ #define PCI_DEVICE_ID_IOMEGA_BUZ	0x4231
 #define PCI_VENDOR_ID_ABOCOM		0x13D1
 #define PCI_DEVICE_ID_ABOCOM_2BD1       0x2BD1
 
+#define PCI_VENDOR_ID_SUNDANCE		0x13f0
+
 #define PCI_VENDOR_ID_CMEDIA		0x13f6
 #define PCI_DEVICE_ID_CMEDIA_CM8338A	0x0100
 #define PCI_DEVICE_ID_CMEDIA_CM8338B	0x0101
-- 
1.3.1


^ permalink raw reply related

* [PATCH 2/2] ipg: redundancy with mii.h
From: Francois Romieu @ 2006-05-02 21:45 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: David Vrabel, linux-kernel, netdev, david
In-Reply-To: <Pine.LNX.4.58.0605020945010.4066@sbz-30.cs.Helsinki.FI>

Replace a bunch of #define with their counterpart from mii.h

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

---

 drivers/net/ipg.c |   82 ++++++++++++++++++++++-------------------------------
 drivers/net/ipg.h |   29 -------------------
 2 files changed, 34 insertions(+), 77 deletions(-)

ea93e36c70b16ab91340e320ed96df1df14ea608
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index ea7c1f8..5be2af1 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -15,6 +15,7 @@
  * craig_rich@sundanceti.com
  */
 #include <linux/crc32.h>
+#include <linux/mii.h>
 
 #define IPG_RX_RING_BYTES	(sizeof(struct RFD) * IPG_RFDLIST_LENGTH)
 #define IPG_TX_RING_BYTES	(sizeof(struct TFD) * IPG_TFDLIST_LENGTH)
@@ -465,7 +466,7 @@ static int ipg_tmi_fiber_detect(struct n
 
 	IPG_DEBUG_MSG("_tmi_fiber_detect\n");
 
-	phyid = read_phy_register(dev, phyaddr, GMII_PHY_ID_1);
+	phyid = read_phy_register(dev, phyaddr, MII_PHYSID1);
 
 	IPG_DEBUG_MSG("PHY ID = %x\n", phyid);
 
@@ -492,7 +493,7 @@ static int ipg_find_phyaddr(struct net_d
 		   GMII_PHY_ID1
 		 */
 
-		status = read_phy_register(dev, phyaddr, GMII_PHY_STATUS);
+		status = read_phy_register(dev, phyaddr, MII_BMSR);
 
 		if ((status != 0xFFFF) && (status != 0))
 			return phyaddr;
@@ -600,20 +601,18 @@ #endif
 
 	IPG_DEBUG_MSG("GMII/MII PHY address = %x\n", phyaddr);
 
-	status = read_phy_register(dev, phyaddr, GMII_PHY_STATUS);
+	status = read_phy_register(dev, phyaddr, MII_BMSR);
 
 	printk("PHYStatus = %x \n", status);
-	if ((status & GMII_PHY_STATUS_AUTONEG_ABILITY) == 0) {
+	if ((status & BMSR_ANEGCAPABLE) == 0) {
 		printk(KERN_INFO
 		       "%s: Error PHY unable to perform auto-negotiation.\n",
 		       dev->name);
 		return -EILSEQ;
 	}
 
-	advertisement = read_phy_register(dev, phyaddr,
-					  GMII_PHY_AUTONEGADVERTISEMENT);
-	linkpartner_ability = read_phy_register(dev, phyaddr,
-						GMII_PHY_AUTONEGLINKPARTABILITY);
+	advertisement = read_phy_register(dev, phyaddr, MII_ADVERTISE);
+	linkpartner_ability = read_phy_register(dev, phyaddr, MII_LPA);
 
 	printk("PHYadvertisement=%x LinkPartner=%x \n", advertisement,
 	       linkpartner_ability);
@@ -634,20 +633,16 @@ #endif
 		 * bits are logic 1 in both registers, configure the
 		 * IPG for full duplex operation.
 		 */
-		if ((advertisement & GMII_PHY_ADV_FULL_DUPLEX) ==
-		    (linkpartner_ability & GMII_PHY_ADV_FULL_DUPLEX)) {
+		if ((advertisement & ADVERTISE_1000XFULL) ==
+		    (linkpartner_ability & ADVERTISE_1000XFULL)) {
 			fullduplex = 1;
 
 			/* In 1000BASE-X using IPG's internal PCS
 			 * layer, so write to the GMII duplex bit.
 			 */
-			write_phy_register(dev,
-					   phyaddr,
-					   GMII_PHY_CONTROL,
-					   read_phy_register
-					   (dev, phyaddr,
-					    GMII_PHY_CONTROL) |
-					   GMII_PHY_CONTROL_FULL_DUPLEX);
+			write_phy_register(dev, phyaddr, MII_BMCR,
+				read_phy_register(dev, phyaddr, MII_BMCR) |
+					   ADVERTISE_1000HALF); // Typo ?
 
 		} else {
 			fullduplex = 0;
@@ -655,13 +650,9 @@ #endif
 			/* In 1000BASE-X using IPG's internal PCS
 			 * layer, so write to the GMII duplex bit.
 			 */
-			write_phy_register(dev,
-					   phyaddr,
-					   GMII_PHY_CONTROL,
-					   read_phy_register
-					   (dev, phyaddr,
-					    GMII_PHY_CONTROL) &
-					   ~GMII_PHY_CONTROL_FULL_DUPLEX);
+			write_phy_register(dev, phyaddr, MII_BMCR,
+				read_phy_register(dev, phyaddr, MII_BMCR) &
+					   ~ADVERTISE_1000HALF); // Typo ?
 		}
 	}
 
@@ -672,21 +663,18 @@ #endif
 		 * link partner abilities exchanged via next page
 		 * transfers.
 		 */
-		gigadvertisement = read_phy_register(dev,
-						     phyaddr,
-						     GMII_PHY_1000BASETCONTROL);
-		giglinkpartner_ability = read_phy_register(dev,
-							   phyaddr,
-							   GMII_PHY_1000BASETSTATUS);
+		gigadvertisement =
+			read_phy_register(dev, phyaddr, MII_CTRL1000);
+		giglinkpartner_ability =
+			read_phy_register(dev, phyaddr, MII_STAT1000);
 
 		/* Compare the full duplex bits in the 1000BASE-T GMII
 		 * registers for the local device, and the link partner.
 		 * If these bits are logic 1 in both registers, configure
 		 * the IPG for full duplex operation.
 		 */
-		if ((gigadvertisement & GMII_PHY_1000BASETCONTROL_FULL_DUPLEX)
-		    && (giglinkpartner_ability &
-			GMII_PHY_1000BASETSTATUS_FULL_DUPLEX)) {
+		if ((gigadvertisement & ADVERTISE_1000FULL) &&
+		    (giglinkpartner_ability & ADVERTISE_1000FULL)) {
 			fullduplex = 1;
 		} else {
 			fullduplex = 0;
@@ -751,8 +739,12 @@ #endif
 		/* In full duplex mode, resolve PAUSE
 		 * functionality.
 		 */
-		switch (((advertisement & GMII_PHY_ADV_PAUSE) >> 5) |
-			((linkpartner_ability & GMII_PHY_ADV_PAUSE) >> 7)) {
+		u8 flow_ctl;
+#define LPA_PAUSE_ANY	(LPA_1000XPAUSE_ASYM | LPA_1000XPAUSE)
+
+		flow_ctl  = (advertisement & LPA_PAUSE_ANY) >> 5;
+		flow_ctl |= (linkpartner_ability & LPA_PAUSE_ANY) >> 7;
+		switch (flow_ctl) {
 		case 0x7:
 			txflowcontrol = 1;
 			rxflowcontrol = 0;
@@ -2682,26 +2674,20 @@ static int ipg_hw_init(struct net_device
 
 	if (phyaddr != -1) {
 		u16 mii_phyctrl, mii_1000cr;
-		mii_1000cr = read_phy_register(dev,
-					       phyaddr,
-					       GMII_PHY_1000BASETCONTROL);
-		write_phy_register(dev, phyaddr,
-				   GMII_PHY_1000BASETCONTROL,
-				   mii_1000cr |
-				   GMII_PHY_1000BASETCONTROL_FULL_DUPLEX |
-				   GMII_PHY_1000BASETCONTROL_HALF_DUPLEX |
+		mii_1000cr =
+			read_phy_register(dev, phyaddr, MII_CTRL1000);
+		write_phy_register(dev, phyaddr, MII_CTRL1000,
+			mii_1000cr | ADVERTISE_1000FULL | ADVERTISE_1000HALF |
 				   GMII_PHY_1000BASETCONTROL_PreferMaster);
 
-		mii_phyctrl = read_phy_register(dev, phyaddr, GMII_PHY_CONTROL);
+		mii_phyctrl = read_phy_register(dev, phyaddr, MII_BMCR);
 		/* Set default phyparam */
 		pci_read_config_byte(sp->pdev, PCI_REVISION_ID, &revisionid);
 		ipg_set_phy_default_param(revisionid, dev, phyaddr);
 
 		/* reset Phy */
-		write_phy_register(dev,
-				   phyaddr, GMII_PHY_CONTROL,
-				   (mii_phyctrl | GMII_PHY_CONTROL_RESET |
-				    MII_PHY_CONTROL_RESTARTAN));
+		write_phy_register(dev, phyaddr, MII_BMCR,
+			(mii_phyctrl | BMCR_RESET | BMCR_ANRESTART));
 
 	}
 
diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index 03bc6f1..cb51b2b 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -86,38 +86,9 @@ #define         MII_PHY_TECHABILITY_ASM_
 #define         MII_PHY_TECHABILITY_RSVD2       0x1000
 #define         MII_PHY_STATUS_AUTONEG_ABILITY  0x0008
 
-/* NIC Physical Layer Device GMII register addresses. */
-#define         GMII_PHY_CONTROL                 0x00
-#define         GMII_PHY_STATUS                  0x01
-#define			GMII_PHY_ID_1                    0x02
-#define         GMII_PHY_AUTONEGADVERTISEMENT    0x04
-#define         GMII_PHY_AUTONEGLINKPARTABILITY  0x05
-#define         GMII_PHY_AUTONEGEXPANSION        0x06
-#define         GMII_PHY_AUTONEGNEXTPAGE         0x07
-#define         GMII_PHY_AUTONEGLINKPARTNEXTPAGE 0x08
-#define         GMII_PHY_EXTENDEDSTATUS          0x0F
-
-#define         GMII_PHY_1000BASETCONTROL        0x09
-#define         GMII_PHY_1000BASETSTATUS         0x0A
-
 /* GMII_PHY_1000 need to set to prefer master */
 #define         GMII_PHY_1000BASETCONTROL_PreferMaster 0x0400
 
-#define         GMII_PHY_1000BASETCONTROL_FULL_DUPLEX 0x0200
-#define         GMII_PHY_1000BASETCONTROL_HALF_DUPLEX 0x0100
-#define         GMII_PHY_1000BASETSTATUS_FULL_DUPLEX 0x0800
-#define         GMII_PHY_1000BASETSTATUS_HALF_DUPLEX 0x0400
-
-/* NIC Physical Layer Device GMII register Fields. */
-#define         GMII_PHY_CONTROL_RESET          0x8000
-#define         GMII_PHY_CONTROL_FULL_DUPLEX    0x0100
-#define         GMII_PHY_STATUS_AUTONEG_ABILITY 0x0008
-#define         GMII_PHY_ADV_FULL_DUPLEX        0x0020
-#define         GMII_PHY_ADV_HALF_DUPLEX        0x0040
-#define         GMII_PHY_ADV_PAUSE              0x0180
-#define         GMII_PHY_ADV_PAUSE_PS1          0x0080
-#define         GMII_PHY_ADV_ASM_DIR_PS2        0x0100
-
 /* NIC Physical Layer Device GMII constants. */
 #define         GMII_PREAMBLE                    0xFFFFFFFF
 #define         GMII_ST                          0x1
-- 
1.3.1


^ permalink raw reply related

* Patch for passing JFFS2 options at mount time
From: Ronny L Nilsson @ 2006-05-02 21:44 UTC (permalink / raw)
  To: linux-mtd

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


Hi

Attached is a patch for passing mount options to JFFS2. I was in the 
need for controlling the compression mode for JFFS2 filesystems on a 
per mount basis but found that up till now a recompile of the kernel 
was the only way to change the active mode in use (?). With this patch 
different filesystems can use different compressor modes, configurable 
at mount time. They can change mode on the fly via a remount too.

For example:
mount -t jffs2 mtd1 /flash -o compressor=none
mount -t jffs2 mtd1 /flash -o compressor=priority


Let me know what you think of it.
Best Regards
/Ronny Nilsson









[-- Attachment #2: jffs2-mountoptions.patch --]
[-- Type: text/x-diff, Size: 8975 bytes --]

diff -rup linux-2.6.15/fs/jffs2/compr.c linux-2.6.15-jffs2-mountoptions/fs/jffs2/compr.c
--- linux-2.6.15/fs/jffs2/compr.c	2006-01-04 07:12:40.000000000 +0100
+++ linux-2.6.15-jffs2-mountoptions/fs/jffs2/compr.c	2006-05-01 16:52:51.000000000 +0200
@@ -9,7 +9,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: compr.c,v 1.46 2005/11/07 11:14:38 gleixner Exp $
+ * $Id: compr.c,v 1.1.2.1 2006/05/01 14:52:51 rln Exp $
  *
  */
 
@@ -20,9 +20,6 @@ static DEFINE_SPINLOCK(jffs2_compressor_
 /* Available compressors are on this list */
 static LIST_HEAD(jffs2_compressor_list);
 
-/* Actual compression mode */
-static int jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY;
-
 /* Statistics for blocks stored without compression */
 static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_compr_size=0;
 
@@ -55,7 +52,7 @@ uint16_t jffs2_compress(struct jffs2_sb_
         uint32_t orig_slen, orig_dlen;
         uint32_t best_slen=0, best_dlen=0;
 
-        switch (jffs2_compression_mode) {
+        switch (c->compression_mode) {
         case JFFS2_COMPR_MODE_NONE:
                 break;
         case JFFS2_COMPR_MODE_PRIORITY:
@@ -268,7 +265,6 @@ int jffs2_unregister_compressor(struct j
         return 0;
 }
 
-#ifdef CONFIG_JFFS2_PROC
 
 #define JFFS2_STAT_BUF_SIZE 16000
 
@@ -317,9 +313,9 @@ char *jffs2_stats(void)
         return buf;
 }
 
-char *jffs2_get_compression_mode_name(void)
+char *jffs2_get_compression_mode_name(const struct jffs2_sb_info *c)
 {
-        switch (jffs2_compression_mode) {
+        switch (c->compression_mode) {
         case JFFS2_COMPR_MODE_NONE:
                 return "none";
         case JFFS2_COMPR_MODE_PRIORITY:
@@ -330,18 +326,37 @@ char *jffs2_get_compression_mode_name(vo
         return "unkown";
 }
 
-int jffs2_set_compression_mode_name(const char *name)
+
+int jffs2_get_dflt_compression_mode(void)
+{
+/* Setting default compression mode */
+#ifdef CONFIG_JFFS2_CMODE_NONE
+        D1(printk(KERN_INFO "JFFS2: default compression mode: none\n");)
+        return JFFS2_COMPR_MODE_NONE;
+#else
+#ifdef CONFIG_JFFS2_CMODE_SIZE
+        D1(printk(KERN_INFO "JFFS2: default compression mode: size\n");)
+        return JFFS2_COMPR_MODE_SIZE;
+#else
+        D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
+	return JFFS2_COMPR_MODE_PRIORITY;
+#endif
+#endif
+}
+
+
+int jffs2_set_compression_mode_name(struct jffs2_sb_info *c, const char *name)
 {
         if (!strcmp("none",name)) {
-                jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
+                c->compression_mode = JFFS2_COMPR_MODE_NONE;
                 return 0;
         }
         if (!strcmp("priority",name)) {
-                jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY;
+                c->compression_mode = JFFS2_COMPR_MODE_PRIORITY;
                 return 0;
         }
         if (!strcmp("size",name)) {
-                jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
+                c->compression_mode = JFFS2_COMPR_MODE_SIZE;
                 return 0;
         }
         return 1;
@@ -404,7 +419,6 @@ reinsert:
         return 0;
 }
 
-#endif
 
 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
 {
@@ -425,18 +439,6 @@ int jffs2_compressors_init(void)
         jffs2_rubinmips_init();
         jffs2_dynrubin_init();
 #endif
-/* Setting default compression mode */
-#ifdef CONFIG_JFFS2_CMODE_NONE
-        jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
-        D1(printk(KERN_INFO "JFFS2: default compression mode: none\n");)
-#else
-#ifdef CONFIG_JFFS2_CMODE_SIZE
-        jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
-        D1(printk(KERN_INFO "JFFS2: default compression mode: size\n");)
-#else
-        D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
-#endif
-#endif
         return 0;
 }
 
diff -rup linux-2.6.15/fs/jffs2/compr.h linux-2.6.15-jffs2-mountoptions/fs/jffs2/compr.h
--- linux-2.6.15/fs/jffs2/compr.h	2006-01-03 07:33:54.000000000 +0100
+++ linux-2.6.15-jffs2-mountoptions/fs/jffs2/compr.h	2006-05-01 16:52:51.000000000 +0200
@@ -7,7 +7,7 @@
  * For licensing information, see the file 'LICENCE' in the
  * jffs2 directory.
  *
- * $Id: compr.h,v 1.9 2005/11/07 11:14:38 gleixner Exp $
+ * $Id: compr.h,v 1.1.2.1 2006/05/01 14:52:51 rln Exp $
  *
  */
 
@@ -37,6 +37,7 @@
 #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */
 #define JFFS2_DYNRUBIN_DISABLED  /*        for decompression */
 
+#define JFFS2_COMPR_MODE_UNKNOWN    (-1)
 #define JFFS2_COMPR_MODE_NONE       0
 #define JFFS2_COMPR_MODE_PRIORITY   1
 #define JFFS2_COMPR_MODE_SIZE       2
@@ -76,15 +77,14 @@ int jffs2_decompress(struct jffs2_sb_inf
 
 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
 
-#ifdef CONFIG_JFFS2_PROC
 int jffs2_enable_compressor_name(const char *name);
 int jffs2_disable_compressor_name(const char *name);
-int jffs2_set_compression_mode_name(const char *mode_name);
-char *jffs2_get_compression_mode_name(void);
+int jffs2_set_compression_mode_name(struct jffs2_sb_info *c, const char *mode_name);
+char *jffs2_get_compression_mode_name(const struct jffs2_sb_info *c);
+int jffs2_get_dflt_compression_mode(void);
 int jffs2_set_compressor_priority(const char *mode_name, int priority);
 char *jffs2_list_compressors(void);
 char *jffs2_stats(void);
-#endif
 
 /* Compressor modules */
 /* These functions will be called by jffs2_compressors_init/exit */
diff -rup linux-2.6.15/fs/jffs2/fs.c linux-2.6.15-jffs2-mountoptions/fs/jffs2/fs.c
--- linux-2.6.15/fs/jffs2/fs.c	2006-01-03 07:33:54.000000000 +0100
+++ linux-2.6.15-jffs2-mountoptions/fs/jffs2/fs.c	2006-05-01 16:52:51.000000000 +0200
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: fs.c,v 1.66 2005/09/27 13:17:29 dedekind Exp $
+ * $Id: fs.c,v 1.1.2.1 2006/05/01 14:52:51 rln Exp $
  *
  */
 
@@ -22,7 +22,9 @@
 #include <linux/vmalloc.h>
 #include <linux/vfs.h>
 #include <linux/crc32.h>
+#include <linux/parser.h>
 #include "nodelist.h"
+#include "compr.h"
 
 static int jffs2_flash_setup(struct jffs2_sb_info *c);
 
@@ -339,6 +341,49 @@ void jffs2_dirty_inode(struct inode *ino
 	jffs2_do_setattr(inode, &iattr);
 }
 
+
+enum {
+	OPT_COMPRESSOR,
+	OPT_ERR
+};
+
+static match_table_t tokens = {
+	{ OPT_COMPRESSOR, "compressor=%s" },
+	{ OPT_ERR, NULL }
+};
+
+
+static int parse_options(struct jffs2_sb_info *c, char *data) {
+	substring_t args[MAX_OPT_ARGS];
+	int needCompr = (c->compression_mode == JFFS2_COMPR_MODE_UNKNOWN);	/* Set default only once. */
+	int token;
+	char *p, *arg;
+
+	while (data && strlen(data) && (p = strsep(&data, ","))) {
+		if (!*p) continue;
+
+		token = match_token(p, tokens, args);
+		switch (token) {
+			case OPT_COMPRESSOR:
+				arg = match_strdup(&args[0]);
+				needCompr = jffs2_set_compression_mode_name(c, arg);
+				kfree(arg);
+				break;
+
+			default:
+				break;
+		}
+	}
+
+	/* Was a valid compressor set by user? 
+	 * Otherwise set default. */
+	if(needCompr) c->compression_mode = jffs2_get_dflt_compression_mode();
+	D1(printk(KERN_DEBUG "jffs2 parse_options() compressor=%d\n", c->compression_mode));
+
+	return 0;
+}
+
+
 int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
 {
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
@@ -361,6 +406,7 @@ int jffs2_remount_fs (struct super_block
 		jffs2_start_garbage_collect_thread(c);
 
 	*flags |= MS_NOATIME;
+	parse_options(c, data);
 
 	return 0;
 }
@@ -491,6 +537,10 @@ int jffs2_do_fill_super(struct super_blo
 	}
 	memset(c->inocache_list, 0, INOCACHE_HASHSIZE * sizeof(struct jffs2_inode_cache *));
 
+	/* Parse mount options */
+	c->compression_mode = JFFS2_COMPR_MODE_UNKNOWN;
+	parse_options(c, data);
+
 	if ((ret = jffs2_do_mount_fs(c)))
 		goto out_inohash;
 
diff -rup linux-2.6.15/include/linux/jffs2_fs_sb.h linux-2.6.15-jffs2-mountoptions/include/linux/jffs2_fs_sb.h
--- linux-2.6.15/include/linux/jffs2_fs_sb.h	2006-01-04 07:13:46.000000000 +0100
+++ linux-2.6.15-jffs2-mountoptions/include/linux/jffs2_fs_sb.h	2006-05-01 16:52:51.000000000 +0200
@@ -1,4 +1,4 @@
-/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
+/* $Id: jffs2_fs_sb.h,v 1.1.2.1 2006/05/01 14:52:51 rln Exp $ */
 
 #ifndef _JFFS2_FS_SB
 #define _JFFS2_FS_SB
@@ -14,8 +14,8 @@
 #include <linux/rwsem.h>
 
 #define JFFS2_SB_FLAG_RO 1
-#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */
-#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */
+#define JFFS2_SB_FLAG_SCANNING 2    /* Flash scanning is in progress */
+#define JFFS2_SB_FLAG_BUILDING 4    /* File system building is in progress */
 
 struct jffs2_inodirty;
 
@@ -30,6 +30,7 @@ struct jffs2_sb_info {
 	uint32_t checked_ino;
 
 	unsigned int flags;
+	int compression_mode;
 
 	struct task_struct *gc_task;	/* GC task struct */
 	struct completion gc_thread_start; /* GC thread start completion */

^ permalink raw reply

* Re: [PATCH]: Allow misc https cert for git-svnimport
From: Eric Wong @ 2006-05-02 21:44 UTC (permalink / raw)
  To: P. Christeas; +Cc: git, Matthias Urlichs
In-Reply-To: <200604281801.07155.p_christ@hol.gr>

"P. Christeas" <p_christ@hol.gr> wrote:
> Just had to access a server with a broken certificate (self signed), so I 
> added that patch to git-svnimport.

Matthias should know more about git-svnimport than I do :)

I'm not fully up-to-date on how the SVN:: modules work for this, nor do
I know off the top of my head an ssl svn server with a self-signed cert
to test with.  I just copied the ssl stuff off svn-mirror a while ago :)

> --- /usr/bin/git-svnimport	2006-04-13 09:39:39.000000000 +0300
> +++ /home/panos/bin/git-svnimport	2006-04-28 17:55:45.000000000 +0300
> @@ -96,9 +96,14 @@
>  sub conn {
>  	my $self = shift;
>  	my $repo = $self->{'fullrep'};
> -	my $auth = SVN::Core::auth_open ([SVN::Client::get_simple_provider,
> +# 	my $auth = SVN::Core::auth_open ([SVN::Client::get_simple_provider,
> +# 			  SVN::Client::get_ssl_server_trust_file_provider,
> +# 			  SVN::Client::get_ssl_server_trust_prompt_provider(\&_trust_callback),
> +# 			  SVN::Client::get_username_provider]);
> +	my $auth = [SVN::Client::get_simple_provider,
>  			  SVN::Client::get_ssl_server_trust_file_provider,
> -			  SVN::Client::get_username_provider]);
> +			  SVN::Client::get_ssl_server_trust_prompt_provider(\&_trust_callback),
> +			  SVN::Client::get_username_provider];
>  	my $s = SVN::Ra->new(url => $repo, auth => $auth);
>  	die "SVN connection to $repo: $!\n" unless defined $s;
>  	$self->{'svn'} = $s;
> @@ -125,6 +130,45 @@
>  	return $name;
>  }
>  
> +sub _trust_callback {
> +	my ($cred,$realm,$ifailed,$server_cert_info,$may_save) = @_;
> +	#$cred->accepted_failures($SVN::Auth::SSL::UNKNOWNCA);
> +	print "SSL certificate is not trusted: $ifailed \n";
> +	print "Fingerprint: " . $server_cert_info->fingerprint . "\n";
> +	print "Hostname:    ". $server_cert_info->hostname ;
> +	print " (MISMATCH)" if ( $ifailed & $SVN::Auth::SSL::CNMISMATCH);
> +	print "\n";
> +	
> +	print "Valid from:  ". $server_cert_info->valid_from;
> +	print " (NOT YET)" if ( $ifailed & $SVN::Auth::SSL::NOTYETVALID);
> +	print "\n";
> +	
> +	print "Valid until: ". $server_cert_info->valid_until;
> +	print " (EXPIRED)" if ( $ifailed & $SVN::Auth::SSL::EXPIRED);
> +	print "\n";
> +	
> +	print "Issuer:      ". $server_cert_info->issuer_dname;
> +	print " (UNKNOWN)" if ( $ifailed & $SVN::Auth::SSL::UNKNOWNCA);
> +	print "\n\n";
> +	
> +	print "Do you still want to accept that certificate? [y/N] ";
> +	my $accept = <STDIN>;
> +	chomp($accept);
> +	print "\n";
> +	if (($accept eq "y") or ($accept eq "Y" )) {
> +		$cred->accepted_failures($ifailed);
> +	# 	print "Save cert, so that it is accepted in future calls? [y/N] ";
> +	# 	my $mmsave = <STDIN>;
> +	# 	chomp($mmsave);
> +	# 	if (($mmsave eq "y") or ($mmsave eq "Y" )) {
> +	# 		$may_save = 1;
> +	# 	}
> +		print "\n";
> +	}
> +
> +}
> +
> +
>  package main;
>  use URI;
>  


-- 
Eric Wong

^ permalink raw reply

* [PATCH] git-send-email: fix version string to be valid perl
From: Martin Langhoff @ 2006-05-02 21:44 UTC (permalink / raw)
  To: git, junkio; +Cc: Martin Langhoff

This makes git-send-email easier to develop and debug, skipping the need
to `make git-send-email` every time.

---

 git-send-email.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

1f6dd44e0c919196f9c3d5d617a64111004f24e5
diff --git a/git-send-email.perl b/git-send-email.perl
index ecfa347..2eb4f6c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -291,6 +291,13 @@ sub send_message
 	my $to = join (",\n\t", @recipients);
 	@recipients = unique_email_list(@recipients,@cc);
 	my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
+	my $gitversion = '@@GIT_VERSION@@';
+	if ($gitversion =~ m/..GIT_VERSION../) {
+	    $gitversion = `git --version`;
+	    chomp $gitversion;
+	    # keep only what's after the last space
+	    $gitversion =~ s/^.* //; 
+	}
 
 	my $header = "From: $from
 To: $to
@@ -299,7 +306,7 @@ Subject: $subject
 Reply-To: $from
 Date: $date
 Message-Id: $message_id
-X-Mailer: git-send-email @@GIT_VERSION@@
+X-Mailer: git-send-email $gitversion
 ";
 	$header .= "In-Reply-To: $reply_to\n" if $reply_to;
 
-- 
1.3.0.rc4.ge6bf-dirty

^ permalink raw reply related

* [PATCH] ia64: remove asm-ia64/bitops.h self-inclusion
From: Jon Mason @ 2006-05-02 21:42 UTC (permalink / raw)
  To: linux-kernel

asm-ia64/bitops.h includes itself.  The #ifndef _ASM_IA64_BITOPS_H
prevents this from being an issue, but it should still be removed.

Cross-compile tested.

Thanks,
Jon

Signed-off-by: Jon Mason <jdmason@us.ibm.com>

diff -r 62dc1eb0c5e2 include/asm-ia64/bitops.h
--- a/include/asm-ia64/bitops.h	Wed Apr 26 16:12:39 2006
+++ b/include/asm-ia64/bitops.h	Tue May  2 16:27:46 2006
@@ -11,7 +11,6 @@
 
 #include <linux/compiler.h>
 #include <linux/types.h>
-#include <asm/bitops.h>
 #include <asm/intrinsics.h>
 
 /**

^ permalink raw reply

* Re: [PATCH 7/7] uts namespaces: Implement CLONE_NEWUTS flag
From: Serge E. Hallyn @ 2006-05-02 17:32 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Serge E. Hallyn, ebiederm, herbert, dev, linux-kernel, sam, xemul,
	clg, frankeh
In-Reply-To: <1146520732.32079.31.camel@localhost.localdomain>

Quoting Dave Hansen (haveblue@us.ibm.com):
> On Mon, 2006-05-01 at 16:11 -0500, Serge E. Hallyn wrote:
> > Might be worth a separate patch to change over all those helpers in
> > fork.c?  (I think they were all brought in along with the sys_unshare
> > syscall)
> 
> I'd be a little scared to touch good, working code, but it couldn't hurt
> to see the patch.

Hmm, well the following untested patch was just to see the end results.
Summary: it ends up quite a bit uglier  :-(

I think I like it better as is.

thanks,
-serge

Subject: [PATCH] fs/fork.c: unshare cleanup

Switch some of the unshare patch to more kernel conformant style.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>

---

 kernel/fork.c |  102 ++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 64 insertions(+), 38 deletions(-)

c30251d8442cfee2ada7dfd6c46159cf44011213
diff --git a/kernel/fork.c b/kernel/fork.c
index d2fa57d..42753a4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1450,86 +1450,92 @@ static int unshare_thread(unsigned long 
 /*
  * Unshare the filesystem structure if it is being shared
  */
-static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp)
+static struct fs_struct * unshare_fs(unsigned long flags)
 {
 	struct fs_struct *fs = current->fs;
+	struct fs_struct *new_fs = NULL;
 
-	if ((unshare_flags & CLONE_FS) &&
+	if ((flags & CLONE_FS) &&
 	    (fs && atomic_read(&fs->count) > 1)) {
-		*new_fsp = __copy_fs_struct(current->fs);
-		if (!*new_fsp)
-			return -ENOMEM;
+		new_fs = __copy_fs_struct(current->fs);
+		if (!new_fs)
+			new_fs = ERR_PTR(-ENOMEM);
 	}
 
-	return 0;
+	return new_fs;
 }
 
 /*
  * Unshare the namespace structure if it is being shared
  */
-static int unshare_namespace(unsigned long unshare_flags, struct namespace **new_nsp, struct fs_struct *new_fs)
+static struct namespace *unshare_namespace(unsigned long flags,
+		struct fs_struct *new_fs)
 {
 	struct namespace *ns = current->namespace;
+	struct namespace *new_ns = NULL;
 
-	if ((unshare_flags & CLONE_NEWNS) &&
+	if ((flags & CLONE_NEWNS) &&
 	    (ns && atomic_read(&ns->count) > 1)) {
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
+		if (!capable(CAP_SYS_ADMIN)) {
+			return ERR_PTR(-EPERM);
 
-		*new_nsp = dup_namespace(current, new_fs ? new_fs : current->fs);
+		*new_ns = dup_namespace(current, new_fs ? new_fs : current->fs);
 		if (!*new_nsp)
-			return -ENOMEM;
+			return ERR_PTR(-ENOMEM);
 	}
 
-	return 0;
+	return new_ns;
 }
 
 /*
  * Unsharing of sighand for tasks created with CLONE_SIGHAND is not
  * supported yet
  */
-static int unshare_sighand(unsigned long unshare_flags, struct sighand_struct **new_sighp)
+static struct sighand_struct *unshare_sighand(unsigned long flags);
 {
 	struct sighand_struct *sigh = current->sighand;
+	struct sighand_struct *new_sigh = NULL;
 
-	if ((unshare_flags & CLONE_SIGHAND) &&
+	if ((flags & CLONE_SIGHAND) &&
 	    (sigh && atomic_read(&sigh->count) > 1))
-		return -EINVAL;
-	else
-		return 0;
+		return ERR_PTR(-EINVAL);
+
+	return new_sigh;
 }
 
 /*
  * Unshare vm if it is being shared
  */
-static int unshare_vm(unsigned long unshare_flags, struct mm_struct **new_mmp)
+static mm_struct *unshare_vm(unsigned long flags)
 {
 	struct mm_struct *mm = current->mm;
+	struct mm_struct *new_mm = NULL;
 
-	if ((unshare_flags & CLONE_VM) &&
+	if ((flags & CLONE_VM) &&
 	    (mm && atomic_read(&mm->mm_users) > 1)) {
-		return -EINVAL;
+		return ERR_PTR(-EINVAL);
 	}
 
-	return 0;
+	return new_mm;
 }
 
 /*
  * Unshare file descriptor table if it is being shared
  */
-static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp)
+static struct files_struct *unshare_fd(unsigned long flags)
 {
 	struct files_struct *fd = current->files;
+	struct files_struct *new_fd = NULL;
 	int error = 0;
 
-	if ((unshare_flags & CLONE_FILES) &&
+	if ((flags & CLONE_FILES) &&
 	    (fd && atomic_read(&fd->count) > 1)) {
-		*new_fdp = dup_fd(fd, &error);
-		if (!*new_fdp)
-			return error;
+		new_fd = dup_fd(fd, &error);
+		if (!new_fd)
+			return ERR_PTR(error);
 	}
 
-	return 0;
+	return new_fd;
 }
 
 /*
@@ -1572,16 +1578,36 @@ asmlinkage long sys_unshare(unsigned lon
 
 	if ((err = unshare_thread(unshare_flags)))
 		goto bad_unshare_out;
-	if ((err = unshare_fs(unshare_flags, &new_fs)))
+
+	new_fs = unshare_fs(unshare_flags);
+	if (IS_ERR(new_fs)) {
+		err = PTR_ERR(new_fs);
 		goto bad_unshare_cleanup_thread;
-	if ((err = unshare_namespace(unshare_flags, &new_ns, new_fs)))
+	}
+
+	new_ns = unshare_namespace(unshare_flags, &new_ns);
+	if (IS_ERR(new_ns)) {
+		err = PTR_ERR(new_ns);
 		goto bad_unshare_cleanup_fs;
-	if ((err = unshare_sighand(unshare_flags, &new_sigh)))
+	}
+
+	new_sigh = unshare_sighand(unshare_flags);
+	if (IS_ERR(new_sigh)) {
+		err = PTR_ERR(new_sigh);
 		goto bad_unshare_cleanup_ns;
-	if ((err = unshare_vm(unshare_flags, &new_mm)))
+	}
+	new_mm = unshare_vm(unshare_flags);
+	if (IS_ERR(new_mm)) {
+		err = PTR_ERR(new_mm);
 		goto bad_unshare_cleanup_sigh;
-	if ((err = unshare_fd(unshare_flags, &new_fd)))
+	}
+
+	new_fd = unshare_fd(unshare_flags);
+	if (IS_ERR(new_fd)) {
+		err = PTR_ERR(new_fd);
 		goto bad_unshare_cleanup_vm;
+	}
+
 	if ((err = unshare_semundo(unshare_flags, &new_ulist)))
 		goto bad_unshare_cleanup_fd;
 
@@ -1626,24 +1652,24 @@ asmlinkage long sys_unshare(unsigned lon
 	}
 
 bad_unshare_cleanup_fd:
-	if (new_fd)
+	if (new_fd && !IS_ERR(new_fd))
 		put_files_struct(new_fd);
 
 bad_unshare_cleanup_vm:
-	if (new_mm)
+	if (new_mm && !IS_ERR(new_mm))
 		mmput(new_mm);
 
 bad_unshare_cleanup_sigh:
-	if (new_sigh)
+	if (new_sigh && !IS_ERR(new_sigh))
 		if (atomic_dec_and_test(&new_sigh->count))
 			kmem_cache_free(sighand_cachep, new_sigh);
 
 bad_unshare_cleanup_ns:
-	if (new_ns)
+	if (new_ns && !IS_ERR(new_ns))
 		put_namespace(new_ns);
 
 bad_unshare_cleanup_fs:
-	if (new_fs)
+	if (new_fs && !IS_ERR(new_fs)))
 		put_fs_struct(new_fs);
 
 bad_unshare_cleanup_thread:
-- 
1.3.0


^ permalink raw reply related

* SO_BINDTODEVICE
From: Ralf Baechle DL5RB @ 2006-05-02 21:42 UTC (permalink / raw)
  To: linux-hams

A question to the programmers on this list.  I'm looking for applications
that are using the setsockopt syscall to set the SO_BINDTODEVICE option
and the level argument set to another value than SOL_SOCKET.  Anybody?

73 de DL5RB op Ralf

--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21

^ permalink raw reply

* Re: cg-mkpatch use case
From: Martin Langhoff @ 2006-05-02 21:41 UTC (permalink / raw)
  To: Belmar-Letelier; +Cc: git
In-Reply-To: <44570E8E.5070402@itaapy.com>

On 5/2/06, Belmar-Letelier <luis@itaapy.com> wrote:
>    What is the Cogito way to apply the result of "cg-mkpatch"

AFAIK, cg-patch. However, cg-mkpatch appeared before cg-patch, so you
may have a version of Cogito without cg-patch.

> 2. What are the difference between usecases with "cg-mkpatch"
>    and "git-format-patch" ?

If you are familiar with git tools, use them instead of cg tools ;-)

Cg is simpler, so if you have relatively simple needs, or a team with
simple needs that doesn't need to know all the git tricks and
internals, it can be a timesaver. In my team, people start with Cg and
eventually evolve into using more and more of git.

cheers,


martin

^ permalink raw reply

* re: exported directories' ownership changing.
From: John McFerran @ 2006-05-02 21:40 UTC (permalink / raw)
  To: nfs

Nevermind.

It's not NFS its cron.hourly/msec that changes ownerships without my 
permission,
- some underdocumented security hole patcher courtesy of Mandrake.




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply

* Re: Add a "enable" sysfs attribute to the pci devices to allow userspace (Xorg) to enable devices without doing foul direct access
From: Dave Airlie @ 2006-05-02 21:40 UTC (permalink / raw)
  To: Jon Smirl
  Cc: Arjan van de Ven, greg, linux-pci, linux-kernel, airlied, pjones,
	akpm
In-Reply-To: <9e4733910605021200y6333a67sd2ff685f666cc6f9@mail.gmail.com>

>
> Allowing user space control of a device without a mechanism to assign
> ownership of the device is a very bad idea. There is no way for one
> user space program to tell if another is messing with the device.
> There has to be a mechanism like opening the device to indicate which
> process owns the device and is allowed to set their state into it (for
> states that can conflict, enabling the device is definitely a state
> that can conflict).

Jon stop being so dramatic, this is just like letting userspace map
the BARs, without ownership through sysfs, which is a good thing, you
can still map /dev/mem, look we have lots of ways to shoot ourselves
in the foot, if we *want* to.

> The rule needs to be that if you want to use a device it has to have a
> driver. Anything else results in chaos. It doesn't matter if these
> drivers have a tiny API, their purpose is to control ownership of the
> hardware.

Again we can already bypass device drivers.... so don't worry so much....

This attribute allows us to enable devices that X otherwise would hand
enable, that's all, it doesn't allow a user with vi to do it ....

> You may call this silly but it is a real pain to spend hours debugging
> code only to discover that it failed because some other app unknown to
> you altered the state of the hardware while you were using it.
>

Again we have lots of ways for this to happen...

Now X is stupid don't get me wrong and sorry Bjorn it might still
enable/disable devices it doesn't use (unless configured with some
arcania in xorg.conf), but this at least is step 1, this should allow
me to remove all the PCI BAR modfiying code from the Linux code paths,
and to be honest that is a very good start, we still need some sort of
VGA arbitration (which is why X actually messes with cards it doesn't
know about, as it has to make sure everyone isn't decoding the VGA
IOs...)

Dave.

^ permalink raw reply

* [uml-devel] how's everything
From: Marshall @ 2006-05-02 21:36 UTC (permalink / raw)
  To: Browning

Seriously how many times did u hear this, If ur unhappy w/ur weight, read up
on how to change this at www.lackitsomeforflaeo.com/t3r/.

leave meantime I'd which it an resolved but

Marshall



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply

* Re: sched_clock() uses are broken
From: Russell King @ 2006-05-02 21:35 UTC (permalink / raw)
  To: Nicolas Pitre, Ingo Molnar; +Cc: Andi Kleen, linux-kernel
In-Reply-To: <Pine.LNX.4.64.0605021521390.28543@localhost.localdomain>

On Tue, May 02, 2006 at 03:23:01PM -0400, Nicolas Pitre wrote:
> On Tue, 2 May 2006, Russell King wrote:
> 
> > On Tue, May 02, 2006 at 03:05:22PM -0400, Nicolas Pitre wrote:
> > > If we're discussing the addition of a sched_clock_diff(), why whouldn't 
> > > shed_clock() return anything it wants in that context?  It could be 
> > > redefined to have a return value meaningful only to shed_clock_diff()?
> > 
> > If we're talking about doing that, we need to replace sched_clock()
> > to ensure that we all users are aware that it has changed.
> > 
> > I did think about that for my original fix proposal, but stepped back
> > because that's a bigger change - and is something for post-2.6.17.
> > The smallest fix (suitable for -rc kernels) is as I detailed.
> 
> Oh agreed.

(Added Ingo - don't know if you saw my original message.)

Actually, I'm not entirely convinced that the smallest fix is going to
be the best solution - it looks too complex.

Note the code change in update_cpu_clock and sched_current_time - arguably
both are buggy as they stand today when the values wrap.

Comments anyone?

diff --git a/include/linux/sched.h b/include/linux/sched.h
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -988,6 +988,11 @@ static inline int set_cpus_allowed(task_
 extern unsigned long long sched_clock(void);
 extern unsigned long long current_sched_time(const task_t *current_task);
 
+static inline unsigned long long sched_clock_diff(unsigned long long t1, unsigned long long t0)
+{
+	return t1 - t0;
+}
+
 /* sched_exec is called by processes performing an exec */
 #ifdef CONFIG_SMP
 extern void sched_exec(void);
diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -731,7 +731,7 @@ static inline void __activate_idle_task(
 static int recalc_task_prio(task_t *p, unsigned long long now)
 {
 	/* Caller must always ensure 'now >= p->timestamp' */
-	unsigned long long __sleep_time = now - p->timestamp;
+	unsigned long long __sleep_time = sched_clock_diff(now, p->timestamp);
 	unsigned long sleep_time;
 
 	if (batch_task(p))
@@ -807,7 +807,7 @@ static void activate_task(task_t *p, run
 	if (!local) {
 		/* Compensate for drifting sched_clock */
 		runqueue_t *this_rq = this_rq();
-		now = (now - this_rq->timestamp_last_tick)
+		now = sched_clock_diff(now, this_rq->timestamp_last_tick)
 			+ rq->timestamp_last_tick;
 	}
 #endif
@@ -2512,8 +2512,10 @@ EXPORT_PER_CPU_SYMBOL(kstat);
 static inline void update_cpu_clock(task_t *p, runqueue_t *rq,
 				    unsigned long long now)
 {
-	unsigned long long last = max(p->timestamp, rq->timestamp_last_tick);
-	p->sched_time += now - last;
+	unsigned long long d1, d2;
+	d1 = sched_clock_diff(now, p->timestamp);
+	d2 = sched_clock_diff(now, rq->timestamp_last_tick);
+	p->sched_time += min(d1, d2);
 }
 
 /*
@@ -2522,11 +2524,13 @@ static inline void update_cpu_clock(task
  */
 unsigned long long current_sched_time(const task_t *tsk)
 {
-	unsigned long long ns;
+	unsigned long long now, d1, d2, ns;
 	unsigned long flags;
 	local_irq_save(flags);
-	ns = max(tsk->timestamp, task_rq(tsk)->timestamp_last_tick);
-	ns = tsk->sched_time + (sched_clock() - ns);
+	now = sched_clock();
+	d1 = sched_clock_diff(now, tsk->timestamp);
+	d2 = sched_clock_diff(now, task_rq(tsk)->timestamp_last_tick);
+	ns = tsk->sched_time + min(d1, d2);
 	local_irq_restore(flags);
 	return ns;
 }
@@ -2925,7 +2929,7 @@ asmlinkage void __sched schedule(void)
 	runqueue_t *rq;
 	prio_array_t *array;
 	struct list_head *queue;
-	unsigned long long now;
+	unsigned long long now, sleep;
 	unsigned long run_time;
 	int cpu, idx, new_prio;
 
@@ -2960,11 +2964,10 @@ need_resched_nonpreemptible:
 
 	schedstat_inc(rq, sched_cnt);
 	now = sched_clock();
-	if (likely((long long)(now - prev->timestamp) < NS_MAX_SLEEP_AVG)) {
-		run_time = now - prev->timestamp;
-		if (unlikely((long long)(now - prev->timestamp) < 0))
-			run_time = 0;
-	} else
+	sleep = sched_clock_diff(now, prev->timestamp);
+	if (likely(sleep < NS_MAX_SLEEP_AVG))
+		run_time = sleep;
+	else
 		run_time = NS_MAX_SLEEP_AVG;
 
 	/*
@@ -3039,8 +3042,8 @@ go_idle:
 	next = list_entry(queue->next, task_t, run_list);
 
 	if (!rt_task(next) && interactive_sleep(next->sleep_type)) {
-		unsigned long long delta = now - next->timestamp;
-		if (unlikely((long long)(now - next->timestamp) < 0))
+		unsigned long long delta = sched_clock_diff(now, next->timestamp);
+		if (unlikely((long long)delta < 0))
 			delta = 0;
 
 		if (next->sleep_type == SLEEP_INTERACTIVE)


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply

* Re: [PATCH] s390: Hypervisor File System
From: Kay Sievers @ 2006-05-02 21:33 UTC (permalink / raw)
  To: Greg KH
  Cc: Kyle Moffett, Michael Holzheu, akpm, schwidefsky, penberg,
	ioe-lkml, joern, linux-kernel
In-Reply-To: <20060502212845.GA30957@kroah.com>

On Tue, May 02, 2006 at 02:28:45PM -0700, Greg KH wrote:
> On Tue, May 02, 2006 at 01:46:03PM +0200, Kay Sievers wrote:
> > On Mon, May 01, 2006 at 10:37:03PM -0700, Greg KH wrote:
> > > On Tue, May 02, 2006 at 07:23:41AM +0200, Kay Sievers wrote:
> > > > If the count of values handled in a transaction is not to high and it
> > > > makes sense to group these values logically, why not just create an
> > > > attribute group for every transaction, which creates dummy attributes
> > > > to fill the values in, and use an "action" file in that group, that
> > > > commits all the values at once to whatever target? That should fit into
> > > > the ioctl use pattern, right?
> > > 
> > > That's what configfs can handle easier.  I think the issue is getting
> > > stuff from the kernel in one atomic snapshot (all the different file
> > > values from the same point in time.)
> > 
> > Sure, but just like an ioctl, the kernel could return the values after
> > writing to the "action" file in the dummy attributes. That would be
> > something like a snapshot, right?
> 
> Yes, but where would the buffer be to return the data to on a write?  In
> the data that the user passed to write?

In the "dummy attribute", allocated by the device instance.

Kay

^ permalink raw reply

* RE: [RFC 2/3] LVHPT - Setup LVHPT
From: Luck, Tony @ 2006-05-02 21:33 UTC (permalink / raw)
  To: Ian Wienand; +Cc: linux-ia64, linux-mm

> Yes that does seem a bit miss-leading.  I guess the point was that
> with short format you dedicate the top areas of your region to page
> tables for each process, with long format it is static.

So perhaps adding the word "virtual" (in between the "lower" and the
"memory") into the help description, and dropping the bit "when there
are a large number of processes in the system" would be clearer?

-Tony

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* RE: [RFC 2/3] LVHPT - Setup LVHPT
From: Luck, Tony @ 2006-05-02 21:33 UTC (permalink / raw)
  To: Ian Wienand; +Cc: linux-ia64, linux-mm
In-Reply-To: <20060502052557.8990.87273.sendpatchset@wagner.orchestra.cse.unsw.EDU.AU>

> Yes that does seem a bit miss-leading.  I guess the point was that
> with short format you dedicate the top areas of your region to page
> tables for each process, with long format it is static.

So perhaps adding the word "virtual" (in between the "lower" and the
"memory") into the help description, and dropping the bit "when there
are a large number of processes in the system" would be clearer?

-Tony

^ permalink raw reply

* Re: [PATCH] s390: Hypervisor File System
From: Greg KH @ 2006-05-02 21:30 UTC (permalink / raw)
  To: Kyle Moffett, Kay Sievers
  Cc: Michael Holzheu, akpm, schwidefsky, penberg, ioe-lkml, joern,
	linux-kernel
In-Reply-To: <13D6E299-061B-46A5-A3CD-12E1075B9451@mac.com>

On Tue, May 02, 2006 at 04:48:42AM -0400, Kyle Moffett wrote:
> On May 2, 2006, at 00:00:53, Greg KH wrote:
> >On Mon, May 01, 2006 at 07:29:23PM -0400, Kyle Moffett wrote:
> >>So my question stands:  What is the _recommended_ way to handle  
> >>simple data types in low-bandwidth/frequency multiple-valued  
> >>transactions to hardware?  Examples include reading/modifying  
> >>framebuffer settings (currently done through IOCTLS), s390 current  
> >>state (up for discussion), etc.  In these cases there needs to be  
> >>an atomic snapshot or write of multiple values at the same time.   
> >>Given the situation it would be _nice_ to use sysfs so the admin  
> >>can do it by hand; makes things shell scriptable and reduces the  
> >>number of binary compatibility issues.
> >
> >I really don't know of a way to use sysfs for this currently, and  
> >hence, am not complaining too much about the different /proc files  
> >that have this kind of information in it at the moment.
> >
> >If you or someone else wants to come up with some kind of solution  
> >for it, I'm sure that many people would be very happy to see it.
> 
> Hmm, ok; I'll see what I can come up with.  Would anybody object to  
> this kind of API (as in my previous email) that uses an open fd as a  
> transaction "handle"?

No, I think Kay played around with something like using the open fd of
the directory as such a lock (or was he using flock on it, I can't
remember now...)

> Example script:
> >## Associate this process with an atomic snapshot
> >## of the /sys/hypervisor/s390 filesystem tree.
> >exec 3>/sys/hypervisor/s390/transaction
> >
> >## Read data from /sys/hypervisor/s390 without
> >## worrying about atomicity; as that's guaranteed
> >## by the open FD 3.
> >ls /sys/hypervisor/s390/cpus
> >cat /sys/hypervisor/s390/some_data_file
> >
> >## Create another reference in this process to the
> >## _same_ atomic snapshot
> >exec 4>&3
> >
> >## Does *not* close out the atomic snapshot
> >exec 3>&-
> >
> >## Yet another ref; still the _same_ snapshot
> >exec 6>/sys/hypervisor/s390/transaction
> >exec 4>&-
> >
> >## Regardless of what has changed in the meantime,
> >## our filesystem tree still looks the same
> >ls /sys/hypervisor/s390/cpus
> >
> >## Write out values
> >echo some_state >/sys/hypervisor/s390/statefile
> >
> >## Decide we don't like the changes and abort
> >echo reset >&6
> >
> >## Release the last copy of the snapshot and
> >## commit modified values
> >exec 6>&-
> 
> 
> This would allow usages like the following:
> >exec 3>/sys/hypervisor/s390/transaction
> >/bin/s390_change_hypervisor_state
> >## Look at new state; decide if we like it or not
> >if [ -z "$I_LIKE_THE_STATE" ]; then
> >	echo reset >&3
> >fi
> >exec 3>&-
> 
> 
> For actually implementing this; I'm considering a design which hangs  
> a transaction off of a "struct file" such that fork() and clone()  
> preserve the same transaction.  When a new process obtains an FD with  
> the given transaction it would add that process' current pointer to a  
> hash-table referencing the transaction data structure so that the open 
> () call could look up the transaction for a given task in the hash  
> table and use the data specified in the transaction.  When a  
> transaction is opened it would read the data atomically from the  
> hardware or in-kernel data structures and store an "initial" copy as  
> well as a "current" copy in per-transaction memory.  As a user could  
> theoretically pin NPROC * size_of_transaction_data * 2 of kernel  
> memory, transaction files should have fairly strict file modes or  
> some sort of resource-accounting semantic.  On a "reset" operation  
> the "initial" copy would be used to overwrite the "current" copy  
> again, and a changed bit would be unset.  Changes would result in the  
> changed bit being set.  When the transaction is closed, if the  
> changed bit is set then the data would be committed atomically, then  
> all the memory would be freed and the transaction removed from the  
> hash table.
> 
> Anything that sounds broken/fishy/"No that's impossible because..."  
> in there?  I appreciate your input; if this sounds feasable I'll try  
> to hack up a patch.

Sounds a bit complex.  Try looking at flock and see if you can pass that
info back to the sysfs attribute owners.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH] wireless/airo: minimal WPA awareness
From: Michal Schmidt @ 2006-05-02 21:29 UTC (permalink / raw)
  To: Dan Williams
  Cc: netdev, John W. Linville, matthieu castet, Javier Achirica,
	Jean Tourrilhes
In-Reply-To: <1145118379.2324.18.camel@localhost.localdomain>

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

Dan Williams wrote:
> airo cards with firmware versions of 5.30.17 and higher support WPA.
> This patch recognizes WPA-capable firmware versions and adds support for
> retrieving the WPA and RSN information elements from the card's scan
> results.  The JOB and FLAG fields are now independent, since there was
> no space left in the FLAG field for FLAG_WPA_CAPABLE.
> 
> Signed-off-by: matthieu castet <castet.matthieu@free.fr>
> Signed-off-by: Dan Williams <dcbw@redhat.com>

Running Linux 2.6.17-rc3-mm1 which has this patch included I get this 
interesting message:
airo(eth0): WPA unsupported (only firmware versions 5.30.17 and greater 
support WPA.  Detected 5.30.17)

airo_test_wpa_capable assumes that the softSubVer part of the firmware 
version number is coded in BCD. Apparently, that's not true.
I have firmware version 5.30.17 and cap_rid.softSubVer is 0x11==17.

Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>

[-- Attachment #2: airo-fix-firmware-version-compare.diff --]
[-- Type: text/plain, Size: 641 bytes --]

diff -Nurp -X linux-mich/Documentation/dontdiff linux-mm/drivers/net/wireless/airo.c linux-mich/drivers/net/wireless/airo.c
--- linux-mm/drivers/net/wireless/airo.c	2006-05-02 20:20:37.000000000 +0200
+++ linux-mich/drivers/net/wireless/airo.c	2006-05-02 23:16:59.000000000 +0200
@@ -2768,7 +2768,7 @@ static int airo_test_wpa_capable(struct 
 
 	/* Only firmware versions 5.30.17 or better can do WPA */
 	if ((cap_rid.softVer > 0x530)
-	  || ((cap_rid.softVer == 0x530) && (cap_rid.softSubVer >= 0x17))) {
+	  || ((cap_rid.softVer == 0x530) && (cap_rid.softSubVer >= 17))) {
 		airo_print_info(name, "WPA is supported.");
 		return 1;
 	}

^ permalink raw reply

* Re: [PATCH] s390: Hypervisor File System
From: Greg KH @ 2006-05-02 21:28 UTC (permalink / raw)
  To: Kay Sievers
  Cc: Kyle Moffett, Michael Holzheu, akpm, schwidefsky, penberg,
	ioe-lkml, joern, linux-kernel
In-Reply-To: <20060502114603.GA14568@vrfy.org>

On Tue, May 02, 2006 at 01:46:03PM +0200, Kay Sievers wrote:
> On Mon, May 01, 2006 at 10:37:03PM -0700, Greg KH wrote:
> > On Tue, May 02, 2006 at 07:23:41AM +0200, Kay Sievers wrote:
> > > If the count of values handled in a transaction is not to high and it
> > > makes sense to group these values logically, why not just create an
> > > attribute group for every transaction, which creates dummy attributes
> > > to fill the values in, and use an "action" file in that group, that
> > > commits all the values at once to whatever target? That should fit into
> > > the ioctl use pattern, right?
> > 
> > That's what configfs can handle easier.  I think the issue is getting
> > stuff from the kernel in one atomic snapshot (all the different file
> > values from the same point in time.)
> 
> Sure, but just like an ioctl, the kernel could return the values after
> writing to the "action" file in the dummy attributes. That would be
> something like a snapshot, right?

Yes, but where would the buffer be to return the data to on a write?  In
the data that the user passed to write?

thanks,

greg k-h

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.