s390 patches for 2.6.24
Subsystems (7)
cover s390 patches for 2.6.24
The current set of s390 patches ready to be pushed once 2.6.23 has hit the streets.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 1/34 cio: rename css to channel_subsystems
From: Cornelia Huck <[email protected]>
Rename css[] to channel_subsystems[] to avoid name clashes.
---
drivers/s390/cio/chp.c | 14 ++++---- drivers/s390/cio/css.c | 69 +++++++++++++++++++++++------------------- drivers/s390/cio/css.h | 2 - drivers/s390/cio/device_fsm.c | 3 + 4 files changed, 49 insertions(+), 39 deletions(-)
drivers/s390/cio/chp.c +7 -7
@@ -55,7 +55,7 @@ static wait_queue_head_t cfg_wait_queue;/* Return channel_path struct for given chpid. */ static inline struct channel_path *chpid_to_chp (struct chp_id chpid) { -return css[chpid.cssid]->chps[chpid.id]; +return channel_subsystems[chpid.cssid]->chps[chpid.id]; }/* Set vary state for given chpid. */
@@ -395,7 +395,7 @@ int chp_new(struct chp_id chpid)/* fill in status, etc. */ chp->chpid = chpid; chp->state =1 ; - chp->dev.parent = &css[chpid.cssid]->device; + chp->dev.parent = &channel_subsystems[chpid.cssid]->device; chp->dev.release = chp_release;snprintf (chp->dev.bus_id,BUS_ID_SIZE ,"chp%x.%02x" , chpid.cssid, chpid.id);
@@ -430,18 +430,18 @@ int chp_new(struct chp_id chpid)device_unregister (&chp->dev); goto out_free; } -mutex_lock (&css[chpid.cssid]->mutex); -if (css[chpid.cssid]->cm_enabled) { +mutex_lock (&channel_subsystems[chpid.cssid]->mutex); +if (channel_subsystems[chpid.cssid]->cm_enabled) { ret =chp_add_cmg_attr (chp);if (ret) {sysfs_remove_group (&chp->dev.kobj, &chp_attr_group);device_unregister (&chp->dev); -mutex_unlock (&css[chpid.cssid]->mutex); +mutex_unlock (&channel_subsystems[chpid.cssid]->mutex); goto out_free; } } - css[chpid.cssid]->chps[chpid.id] = chp; -mutex_unlock (&css[chpid.cssid]->mutex); + channel_subsystems[chpid.cssid]->chps[chpid.id] = chp; +mutex_unlock (&channel_subsystems[chpid.cssid]->mutex);return ret; out_free:kfree (chp);
drivers/s390/cio/css.c +39 -30
127 lines not on this page · raw message
drivers/s390/cio/css.h +1 -1
@@ -167,7 +167,7 @@ struct channel_subsystem {#define to_css (dev) container_of(dev, struct channel_subsystem, device)extern struct bus_type css_bus_type; -extern struct channel_subsystem *css[]; +extern struct channel_subsystem *channel_subsystems[];/* Some helper functions for disconnected state. */ int device_is_disconnected (struct subchannel *);
drivers/s390/cio/device_fsm.c +2 -1
@@ -446,7 +446,8 @@ static void __ccw_device_get_common_pgidif (cdev->private->pgid[last].inf.ps.state1 ==SNID_STATE1_RESET )/* No previous pgid found */ -memcpy (&cdev->private->pgid[0 ], &css[0 ]->global_pgid, +memcpy (&cdev->private->pgid[0 ], + &channel_subsystems[0 ]->global_pgid,sizeof (struct pgid ));else /* Use existing pgid */
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 2/34 cio: remove subchannel_add_files()
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
subchannel_add_files() no longer exists, remove from header.
---
drivers/s390/cio/css.h | 1 - 1 file changed, 1 deletion(-)
drivers/s390/cio/css.h +0 -1
@@ -191,6 +191,5 @@ int sch_is_pseudo_sch(struct subchannelextern struct workqueue_struct *slow_path_wq; -int subchannel_add_files (struct device *);extern struct attribute_group *subch_attr_groups[];#endif
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 3/34 cio: Fix some coding style issues in cmf.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
Fix some formatting and correct a comment.
---
drivers/s390/cio/cmf.c | 141 ++++++++++++++++++++++++++----------------------- include/asm-s390/cmb.h | 8 +- 2 files changed, 81 insertions(+), 68 deletions(-)
drivers/s390/cio/cmf.c +77 -64
@@ -45,7 +45,8 @@#include "ioasm.h" #include "chsc.h" -/* parameter to enable cmf during boot, possible uses are: +/* +* parameter to enable cmf during boot, possible uses are: * "s390cmf" -- enable cmf and allocate 2 MB of ram so measuring can be * used on any subchannel * "s390cmf=<num>" -- enable cmf and allocate enough memory to measure
@@ -84,6 +85,7 @@ enum cmb_format {CMF_EXTENDED , CMF_AUTODETECT = -1, }; +/** * format - actual format for all measurement blocks *
@@ -111,13 +113,13 @@ module_param(format, bool, 0444);* @align: align an allocated block so that the hardware can use it */ struct cmb_operations { -int (*alloc) (struct ccw_device *); -void (*free) (struct ccw_device *); -int (*set) (struct ccw_device *,u32 ); -u64 (*read) (struct ccw_device *,int ); -int (*readall)(struct ccw_device *,struct cmbdata *); -void (*reset) (struct ccw_device *); -void * (*align) (void *); +int (*alloc) (struct ccw_device *); +void (*free) (struct ccw_device *); +int (*set) (struct ccw_device *,u32 ); +u64 (*read) (struct ccw_device *,int ); +int (*readall)(struct ccw_device *,struct cmbdata *); +void (*reset) (struct ccw_device *); +void *(*align) (void *);struct attribute_group *attr_group; };
@@ -130,9 +132,11 @@ struct cmb_data {unsigned long long last_update;/* when last_block was updated */ }; -/* our user interface is designed in terms of nanoseconds, +/* +* Our user interface is designed in terms of nanoseconds, * while the hardware measures total times in its own -* unit.*/ +* unit. +*/ static inline u64 time_to_nsec (u32 value) {return ((u64 )value) *128000ull ;
@@ -159,12 +163,13 @@ static inline u64 time_to_avg_nsec(u32 vreturn ret; } -/* activate or deactivate the channel monitor. When area is NULL, +/* +* Activate or deactivate the channel monitor. When area is NULL, * the monitor is deactivated. The channel monitor needs to * be active in order to measure subchannels, which also need -* to be enabled. */ -static inline void -cmf_activate (void *area,unsigned int onoff) +* to be enabled. +*/ +static inline void cmf_activate (void *area,unsigned int onoff) { registervoid * __gpr2 asm("2" ); registerlong __gpr1 asm("1" );
@@ -175,8 +180,8 @@ cmf_activate(void *area, unsigned int on asm("schm" : :"d" (__gpr2),"d" (__gpr1) ); } -static int -set_schib (struct ccw_device *cdev,u32 mme,int mbfc,unsigned long address) +static int set_schib (struct ccw_device *cdev,u32 mme,int mbfc, +unsigned long address) {int ret;int retry;
@@ -484,15 +489,14 @@ static struct cmb_area cmb_area = {/* ****** old style CMB handling ********/ -/** int maxchannels -* +/* * Basic channel measurement blocks are allocated in one contiguous * block of memory, which can not be moved as long as any channel * is active. Therefore, a maximum number of subchannels needs to * be defined somewhere. This is a module parameter, defaulting to * a resonable value of 1024, or 32 kb of memory. * Current kernels don't allow kmalloc with more than 128kb, so the -* maximum is 4096 +* maximum is 4096. */ module_param_named (maxchannels, cmb_area.num_channels, uint,0444 );
@@ -516,8 +520,9 @@ struct cmb {u32 reserved[2 ]; }; -/* insert a single device into the cmb_area list -* called with cmb_area.lock held from alloc_cmb +/* +* Insert a single device into the cmb_area list. +* Called with cmb_area.lock held from alloc_cmb. */ static int alloc_cmb_single (struct ccw_device *cdev,struct cmb_data *cmb_data)
@@ -532,9 +537,11 @@ static int alloc_cmb_single(struct ccw_d goto out; } -/* find first unused cmb in cmb_area.mem. -* this is a little tricky: cmb_area.list -* remains sorted by ->cmb->hw_data pointers */ +/* +* Find first unused cmb in cmb_area.mem. +* This is a little tricky: cmb_area.list +* remains sorted by ->cmb->hw_data pointers. +*/ cmb = cmb_area.mem;list_for_each_entry (node, &cmb_area.list, cmb_list) {struct cmb_data *data;
@@ -558,8 +565,7 @@ out:return ret; } -static int -alloc_cmb (struct ccw_device *cdev) +static int alloc_cmb (struct ccw_device *cdev) {int ret;struct cmb *mem;
@@ -670,7 +676,7 @@ static int set_cmb(struct ccw_device *cdreturn set_schib_wait (cdev, mme,0 , offset); } -static u64 read_cmb (struct ccw_device *cdev,int index) +static u64 read_cmb (struct ccw_device *cdev,int index) {struct cmb *cmb;u32 val;
@@ -720,7 +726,7 @@ out:return ret; } -static int readall_cmb (struct ccw_device *cdev,struct cmbdata *data) +static int readall_cmb (struct ccw_device *cdev,struct cmbdata *data) {struct cmb *cmb;struct cmb_data *cmb_data;
@@ -816,10 +822,12 @@ struct cmbe {u32 reserved[7 ]; }; -/* kmalloc only guarantees 8 byte alignment, but we need cmbe +/* +* kmalloc only guarantees 8 byte alignment, but we need cmbe * pointers to be naturally aligned. Make sure to allocate -* enough space for two cmbes */ -static inline struct cmbe *cmbe_align (struct cmbe *c) +* enough space for two cmbes. +*/ +static inline struct cmbe *cmbe_align (struct cmbe *c) {unsigned long addr; addr = ((unsigned long)c + sizeof (struct cmbe) - sizeof(long)) &
@@ -827,7 +835,7 @@ static inline struct cmbe* cmbe_align(streturn (struct cmbe *)addr; } -static int alloc_cmbe (struct ccw_device *cdev) +static int alloc_cmbe (struct ccw_device *cdev) {struct cmbe *cmbe;struct cmb_data *cmb_data;
@@ -873,7 +881,7 @@ out_free:return ret; } -static void free_cmbe (struct ccw_device *cdev) +static void free_cmbe (struct ccw_device *cdev) {struct cmb_data *cmb_data;
@@ -912,7 +920,7 @@ static int set_cmbe(struct ccw_device *c } -static u64 read_cmbe (struct ccw_device *cdev,int index) +static u64 read_cmbe (struct ccw_device *cdev,int index) {struct cmbe *cmb;struct cmb_data *cmb_data;
@@ -970,7 +978,7 @@ out:return ret; } -static int readall_cmbe (struct ccw_device *cdev,struct cmbdata *data) +static int readall_cmbe (struct ccw_device *cdev,struct cmbdata *data) {struct cmbe *cmb;struct cmb_data *cmb_data;
@@ -1049,15 +1057,15 @@ static struct cmb_operations cmbops_exte }; -static ssize_t -cmb_show_attr (struct device *dev,char *buf,enum cmb_index idx) +static ssize_t cmb_show_attr (struct device *dev,char *buf,enum cmb_index idx) {return sprintf (buf,"%lld\n" , (unsigned long long )cmf_read (to_ccwdev (dev), idx)); } -static ssize_t -cmb_show_avg_sample_interval (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t cmb_show_avg_sample_interval (struct device *dev, +struct device_attribute *attr, +char *buf) {struct ccw_device *cdev;long interval;
@@ -1079,8 +1087,9 @@ cmb_show_avg_sample_interval(struct devireturn sprintf (buf,"%ld\n" , interval); } -static ssize_t -cmb_show_avg_utilization (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t cmb_show_avg_utilization (struct device *dev, +struct device_attribute *attr, +char *buf) {struct cmbdata data;u64 utilization;
@@ -1112,14 +1121,16 @@ cmb_show_avg_utilization(struct device * }#define cmf_attr (name) \ -static ssize_t show_ ## name (struct device * dev, struct device_attribute *attr, char * buf) \ -{ return cmb_show_attr((dev), buf, cmb_ ## name); } \ -static DEVICE_ATTR(name, 0444, show_ ## name, NULL); +static ssize_t show_##name(struct device *dev, \ + struct device_attribute *attr, char *buf) \ +{ return cmb_show_attr((dev), buf, cmb_##name); } \ +static DEVICE_ATTR(name, 0444, show_##name, NULL);#define cmf_attr_avg (name) \ -static ssize_t show_avg_ ## name (struct device * dev, struct device_attribute *attr, char * buf) \ -{ return cmb_show_attr((dev), buf, cmb_ ## name); } \ -static DEVICE_ATTR(avg_ ## name, 0444, show_avg_ ## name, NULL); +static ssize_t show_avg_##name(struct device *dev, \ + struct device_attribute *attr, char *buf) \ +{ return cmb_show_attr((dev), buf, cmb_##name); } \ +static DEVICE_ATTR(avg_##name, 0444, show_avg_##name, NULL);cmf_attr (ssch_rsch_count);cmf_attr (sample_count);
@@ -1131,7 +1142,8 @@ cmf_attr_avg(device_active_only_time);cmf_attr_avg (device_busy_time);cmf_attr_avg (initial_command_response_time); -static DEVICE_ATTR(avg_sample_interval, 0444, cmb_show_avg_sample_interval, NULL); +static DEVICE_ATTR(avg_sample_interval, 0444, cmb_show_avg_sample_interval, + NULL); static DEVICE_ATTR(avg_utilization, 0444, cmb_show_avg_utilization, NULL);static struct attribute *cmf_attributes[] = {
@@ -1172,12 +1184,16 @@ static struct attribute_group cmf_attr_g .attrs = cmf_attributes_ext, }; -static ssize_t cmb_enable_show (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t cmb_enable_show (struct device *dev, +struct device_attribute *attr, +char *buf) {return sprintf (buf,"%d\n" ,to_ccwdev (dev)->private->cmb ?1 :0 ); } -static ssize_t cmb_enable_store (struct device *dev,struct device_attribute *attr,const char *buf,size_t c) +static ssize_t cmb_enable_store (struct device *dev, +struct device_attribute *attr,const char *buf, +size_t c) {struct ccw_device *cdev;int ret;
@@ -1203,8 +1219,7 @@ static ssize_t cmb_enable_store(struct dDEVICE_ATTR (cmb_enable,0644 , cmb_enable_show, cmb_enable_store);/* enable_cmf/disable_cmf: module interface for cmf (de)activation */ -int -enable_cmf (struct ccw_device *cdev) +int enable_cmf (struct ccw_device *cdev) {int ret;
@@ -1225,8 +1240,7 @@ enable_cmf(struct ccw_device *cdev)return ret; } -int -disable_cmf (struct ccw_device *cdev) +int disable_cmf (struct ccw_device *cdev) {int ret;
@@ -1238,14 +1252,12 @@ disable_cmf(struct ccw_device *cdev)return ret; } -u64 -cmf_read (struct ccw_device *cdev,int index) +u64 cmf_read (struct ccw_device *cdev,int index) {return cmbops->read (cdev, index); } -int -cmf_readall (struct ccw_device *cdev,struct cmbdata *data) +int cmf_readall (struct ccw_device *cdev,struct cmbdata *data) {return cmbops->readall (cdev, data); }
@@ -1257,15 +1269,16 @@ int cmf_reenable(struct ccw_device *cdevreturn cmbops->set (cdev,2 ); } -static int __init -init_cmf (void ) +static int __init init_cmf (void ) {char *format_string;char *detect_string ="parameter" ; -/* We cannot really autoprobe this. If the user did not give a parameter, -see if we are running on z990 or up, otherwise fall back to basic mode. */ - +/* +* If the user did not give a parameter, see if we are running on a +* machine supporting extended measurement blocks, otherwise fall back +* to basic mode. +*/ if (format ==CMF_AUTODETECT ) {if (!css_characteristics_avail || !css_general_characteristics.ext_mb) {
@@ -1284,7 +1297,7 @@ init_cmf(void) cmbops = &cmbops_basic;break ;case CMF_EXTENDED : - format_string ="extended" ; + format_string ="extended" ; cmbops = &cmbops_extended;break ;default :
include/asm-s390/cmb.h +4 -4
@@ -41,11 +41,11 @@ struct cmbdata { };/* enable channel measurement */ -#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) +#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER, 32)/* enable channel measurement */ -#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) +#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER, 33)/* read channel measurement data */ -#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) +#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER, 33, struct cmbdata)#ifdef __KERNEL__struct ccw_device ;
@@ -87,7 +87,7 @@ extern u64 cmf_read(struct ccw_device *c* Context: * any **/ -extern int cmf_readall (struct ccw_device *cdev,struct cmbdata *data); +extern int cmf_readall (struct ccw_device *cdev,struct cmbdata *data);#endif /* __KERNEL__ */ #endif /* S390_CMB_H */
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 4/34 cio: Kerneldoc comments for cmf.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
- Fix existing kerneldoc-style comments.
- Move descriptions of functions from cmb.h to cmf.c.
---
drivers/s390/cio/cmf.c | 87 +++++++++++++++++++++++++++++++++++++++++-------- include/asm-s390/cmb.h | 65 ++++++++---------------------------- 2 files changed, 89 insertions(+), 63 deletions(-)
drivers/s390/cio/cmf.c +74 -13
@@ -74,19 +74,20 @@ enum cmb_index {* enum cmb_format - types of supported measurement block formats * * @CMF_BASIC: traditional channel measurement blocks supported -* by all machines that we run on +* by all machines that we run on * @CMF_EXTENDED: improved format that was introduced with the z990 -* machine -* @CMF_AUTODETECT: default: use extended format when running on a z990 -* or later machine, otherwise fall back to basic format -**/ +* machine +* @CMF_AUTODETECT: default: use extended format when running on a machine +* supporting extended format, otherwise fall back to +* basic format +*/ enum cmb_format {CMF_BASIC ,CMF_EXTENDED ,CMF_AUTODETECT =-1 , }; -/** +/* * format - actual format for all measurement blocks * * The format module parameter can be set to a value of 0 (zero)
@@ -107,6 +108,7 @@ module_param(format, bool, 0444);* either with the help of a special pool or with kmalloc * @free: free memory allocated with @alloc * @set: enable or disable measurement +* @read: read a measurement entry at an index * @readall: read a measurement block in a common format * @reset: clear the data in the associated measurement block and * reset its time stamp
@@ -120,7 +122,7 @@ struct cmb_operations {int (*readall)(struct ccw_device *,struct cmbdata *);void (*reset) (struct ccw_device *);void *(*align) (void *); - +/* private: */ struct attribute_group *attr_group; };static struct cmb_operations *cmbops;
@@ -471,6 +473,7 @@ static void cmf_generic_reset(struct ccw* * @mem: pointer to CMBs (only in basic measurement mode) * @list: contains a linked list of all subchannels +* @num_channels: number of channels to be measured * @lock: protect concurrent access to @mem and @list */ struct cmb_area {
@@ -503,10 +506,20 @@ module_param_named(maxchannels, cmb_area/** * struct cmb - basic channel measurement block +* @ssch_rsch_count: number of ssch and rsch +* @sample_count: number of samples +* @device_connect_time: time of device connect +* @function_pending_time: time of function pending +* @device_disconnect_time: time of device disconnect +* @control_unit_queuing_time: time of control unit queuing +* @device_active_only_time: time of device active only +* @reserved: unused in basic measurement mode +* +* The measurement block as used by the hardware. The fields are described +* further in z/Architecture Principles of Operation, chapter 17. * -* cmb as used by the hardware the fields are described in z/Architecture -* Principles of Operation, chapter 17. -* The area to be a contiguous array and may not be reallocated or freed. +* The cmb area made up from these blocks must be a contiguous array and may +* not be reallocated or freed. * Only one cmb area can be present in the system. */ struct cmb {
@@ -804,9 +817,20 @@ static struct cmb_operations cmbops_basi/** * struct cmbe - extended channel measurement block +* @ssch_rsch_count: number of ssch and rsch +* @sample_count: number of samples +* @device_connect_time: time of device connect +* @function_pending_time: time of function pending +* @device_disconnect_time: time of device disconnect +* @control_unit_queuing_time: time of control unit queuing +* @device_active_only_time: time of device active only +* @device_busy_time: time of device busy +* @initial_command_response_time: initial command response time +* @reserved: unused * -* cmb as used by the hardware, may be in any 64 bit physical location, -* the fields are described in z/Architecture Principles of Operation, +* The measurement block as used by the hardware. May be in any 64 bit physical +* location. +* The fields are described further in z/Architecture Principles of Operation, * third edition, chapter 17. */ struct cmbe {
@@ -1218,7 +1242,15 @@ static ssize_t cmb_enable_store(struct dDEVICE_ATTR (cmb_enable,0644 , cmb_enable_show, cmb_enable_store); -/* enable_cmf/disable_cmf: module interface for cmf (de)activation */ +/** +* enable_cmf() - switch on the channel measurement for a specific device +* @cdev: The ccw device to be enabled +* +* Returns %0 for success or a negative error value. +* +* Context: +* non-atomic +*/ int enable_cmf (struct ccw_device *cdev) {int ret;
@@ -1240,6 +1272,15 @@ int enable_cmf(struct ccw_device *cdev)return ret; } +/** +* disable_cmf() - switch off the channel measurement for a specific device +* @cdev: The ccw device to be disabled +* +* Returns %0 for success or a negative error value. +* +* Context: +* non-atomic +*/ int disable_cmf (struct ccw_device *cdev) {int ret;
@@ -1252,11 +1293,31 @@ int disable_cmf(struct ccw_device *cdev)return ret; } +/** +* cmf_read() - read one value from the current channel measurement block +* @cdev: the channel to be read +* @index: the index of the value to be read +* +* Returns the value read or %0 if the value cannot be read. +* +* Context: +* any +*/ u64 cmf_read (struct ccw_device *cdev,int index) {return cmbops->read (cdev, index); } +/** +* cmf_readall() - read the current channel measurement block +* @cdev: the channel to be read +* @data: a pointer to a data block that will be filled +* +* Returns %0 on success, a negative error value otherwise. +* +* Context: +* any +*/ int cmf_readall (struct ccw_device *cdev,struct cmbdata *data) {return cmbops->readall (cdev, data);
include/asm-s390/cmb.h +15 -50
88 lines not on this page · raw message
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 5/34 cio: Add docbook comments.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
Comment a bunch of function in docbook style and convert existing comments on structures to docbook.
---
drivers/s390/cio/ccwgroup.c | 67 +++++++-- drivers/s390/cio/device.c | 64 +++++++-- drivers/s390/cio/device_ops.c | 241 ++++++++++++++++++++++++++++++----- include/asm-s390/ccwdev.h | 75 ++++------ include/asm-s390/ccwgroup.h | 32 +++- include/asm-s390/cio.h | 288 +++++++++++++++++++++++++++++------------- 6 files changed, 575 insertions(+), 192 deletions(-)
drivers/s390/cio/ccwgroup.c +50 -17
@@ -152,16 +152,24 @@ __ccwgroup_create_symlinks(struct ccwgroreturn 0 ; } -/* -* try to add a new ccwgroup device for one driver -* argc and argv[] are a list of bus_id's of devices -* belonging to the driver. +/** +* ccwgroup_create() - create and register a ccw group device +* @root: parent device for the new device +* @creator_id: identifier of creating driver +* @cdrv: ccw driver of slave devices +* @argc: number of slave devices +* @argv: bus ids of slave devices +* +* Create and register a new ccw group device as a child of @root. Slave +* devices are obtained from the list of bus ids given in @argv[] and must all +* belong to @cdrv. +* Returns: +* %0 on success and an error code on failure. +* Context: +* non-atomic */ -int -ccwgroup_create (struct device *root, -unsigned int creator_id, -struct ccw_driver *cdrv, -int argc,char *argv[]) +int ccwgroup_create (struct device *root,unsigned int creator_id, +struct ccw_driver *cdrv,int argc,char *argv[]) {struct ccwgroup_device *gdev;int i;
@@ -390,8 +398,13 @@ static struct bus_type ccwgroup_bus_type .remove = ccwgroup_remove, }; -int -ccwgroup_driver_register (struct ccwgroup_driver *cdriver) +/** +* ccwgroup_driver_register() - register a ccw group driver +* @cdriver: driver to be registered +* +* This function is mainly a wrapper around driver_register(). +*/ +int ccwgroup_driver_register (struct ccwgroup_driver *cdriver) {/* register our new driver with the core */ cdriver->driver.bus = &ccwgroup_bus_type;
@@ -406,8 +419,13 @@ __ccwgroup_match_all(struct device *dev,return 1 ; } -void -ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver) +/** +* ccwgroup_driver_unregister() - deregister a ccw group driver +* @cdriver: driver to be deregistered +* +* This function is mainly a wrapper around driver_unregister(). +*/ +void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver) {struct device *dev;
@@ -427,8 +445,16 @@ ccwgroup_driver_unregister (struct ccwgrdriver_unregister (&cdriver->driver); } -int -ccwgroup_probe_ccwdev (struct ccw_device *cdev) +/** +* ccwgroup_probe_ccwdev() - probe function for slave devices +* @cdev: ccw device to be probed +* +* This is a dummy probe function for ccw devices that are slave devices in +* a ccw group device. +* Returns: +* always %0 +*/ +int ccwgroup_probe_ccwdev (struct ccw_device *cdev) {return 0 ; }
@@ -452,8 +478,15 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_dreturn NULL ; } -void -ccwgroup_remove_ccwdev (struct ccw_device *cdev) +/** +* ccwgroup_remove_ccwdev() - remove function for slave devices +* @cdev: ccw device to be removed +* +* This is a remove function for ccw devices that are slave devices in a ccw +* group device. It sets the ccw device offline and also deregisters the +* embedding ccw group device. +*/ +void ccwgroup_remove_ccwdev (struct ccw_device *cdev) {struct ccwgroup_device *gdev;
drivers/s390/cio/device.c +54 -10
94 lines not on this page · raw message
drivers/s390/cio/device_ops.c +211 -30
319 lines not on this page · raw message
include/asm-s390/ccwdev.h +33 -42
105 lines not on this page · raw message
include/asm-s390/ccwgroup.h +27 -5
@@ -4,19 +4,41 @@struct ccw_device ;struct ccw_driver ; +/** +* struct ccwgroup_device - ccw group device +* @creator_id: unique number of the driver +* @state: online/offline state +* @count: number of attached slave devices +* @dev: embedded device structure +* @cdev: variable number of slave devices, allocated as needed +*/ struct ccwgroup_device { -unsigned long creator_id;/* unique number of the driver */ +unsigned long creator_id;enum {CCWGROUP_OFFLINE ,CCWGROUP_ONLINE , } state; +/* private: */ atomic_t onoff;struct mutex reg_mutex; -unsigned int count;/* number of attached slave devices */ -struct device dev;/* master device */ -struct ccw_device *cdev[0 ];/* variable number, allocate as needed */ +/* public: */ +unsigned int count; +struct device dev; +struct ccw_device *cdev[0 ]; }; +/** +* struct ccwgroup_driver - driver for ccw group devices +* @owner: driver owner +* @name: driver name +* @max_slaves: maximum number of slave devices +* @driver_id: unique id +* @probe: function called on probe +* @remove: function called on remove +* @set_online: function called when device is set online +* @set_offline: function called when device is set offline +* @driver: embedded driver structure +*/ struct ccwgroup_driver {struct module *owner;char *name;
@@ -28,7 +50,7 @@ struct ccwgroup_driver {int (*set_online) (struct ccwgroup_device *);int (*set_offline) (struct ccwgroup_device *); -struct device_driver driver;/* this driver */ +struct device_driver driver; };extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
include/asm-s390/cio.h +200 -88
354 lines not on this page · raw message
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 6/34 cio: Add s390-drivers book.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
s390-drivers is generated using the docbook comments. It should eventually supersede Documentation/s390/cds.txt.
---
Documentation/DocBook/Makefile | 2 Documentation/DocBook/s390-drivers.tmpl | 149 ++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 1 deletion(-)
Documentation/DocBook/Makefile +1 -1
@@ -11,7 +11,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mc procfs-guide.xml writing_usb_driver.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ - genericirq.xml + genericirq.xml s390-drivers.xml ### # The build process is as follows (targets):
Documentation/DocBook/s390-drivers.tmpl new file +149 -0
149 lines not on this page · raw message
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 7/34 cio: Minor style fixes.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
---
drivers/s390/cio/chp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/cio/chp.c +4 -4
@@ -14,7 +14,7 @@#include <linux/jiffies.h> #include <linux/wait.h> #include <linux/mutex.h> -#include <asm/errno.h> +#include <linux/errno.h> #include <asm/chpid.h> #include <asm/sclp.h>
@@ -86,7 +86,7 @@ u8 chp_get_sch_opm(struct subchannel *sc opm =0 ;chp_id_init (&chpid); -for (i=0 ; i <8 ; i++) { +for (i =0 ; i <8 ; i++) { opm <<=1 ; chpid.id = sch->schib.pmcw.chpid[i];if (chp_get_status (chpid) !=0 )
@@ -118,7 +118,7 @@ static int s390_vary_chpid(struct chp_idsprintf (dbf_text, on?"varyon%x.%02x" :"varyoff%x.%02x" , chpid.cssid, chpid.id); -CIO_TRACE_EVENT (2 , dbf_text); +CIO_TRACE_EVENT (2 , dbf_text); status =chp_get_status (chpid);if (!on && !status) {
@@ -353,7 +353,7 @@ static ssize_t chp_shared_show(struct de static DEVICE_ATTR(shared, 0444, chp_shared_show, NULL); -static struct attribute * chp_attrs[] = { +static struct attribute *chp_attrs[] = { &dev_attr_status.attr, &dev_attr_configure.attr, &dev_attr_type.attr,
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 8/34 cio: Disable channel path measurements on shutdown/reboot.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
Make sure channel path measurements are disabled via a reboot notifier since we cannot rely on userspace to disable it again after enabling it. This is 1. clean and 2. makes sure that channel path measurements do not stay enabled after a reboot not involving a subsystem reset (which would lead to the channel subsystem scribbling onto random memory).
---
drivers/s390/cio/css.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/s390/cio/css.c +29 -0
@@ -13,6 +13,7 @@#include <linux/slab.h> #include <linux/errno.h> #include <linux/list.h> +#include <linux/reboot.h> #include "css.h" #include "cio.h"
@@ -632,6 +633,29 @@ static int __init setup_css(int nr)return 0 ; } +static int css_reboot_event (struct notifier_block *this, +unsigned long event, +void *ptr) +{ +int ret, i; + + ret =NOTIFY_DONE ; +for (i =0 ; i <= __MAX_CSSID; i++) { +struct channel_subsystem *css; + + css = channel_subsystems[i]; +if (css->cm_enabled) +if (chsc_secm (css,0 )) + ret =NOTIFY_BAD ; + } + +return ret; +} + +static struct notifier_block css_reboot_notifier = { + .notifier_call = css_reboot_event, +}; +/* * Now that the driver core is running, we can setup our channel subsystem. * The struct subchannel's are created during probing (except for the
@@ -697,12 +721,17 @@ init_channel_subsystem (void)if (ret) goto out_file; } + ret =register_reboot_notifier (&css_reboot_notifier); +if (ret) + goto out_pseudo; css_init_done =1 ;ctl_set_bit (6 ,28 );for_each_subchannel (__init_channel_subsystem,NULL );return 0 ; +out_pseudo: +device_unregister (&channel_subsystems[i]->pseudo_subchannel->dev); out_file:device_remove_file (&channel_subsystems[i]->device, &dev_attr_cm_enable);
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 9/34 cio: Introduce ccw_bus_type.shutdown.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
Introduce a shutdown method for the ccw bus that calls the driver specific shutdown method in struct ccw_driver.
Switch zfcp to the new ccw_driver shutdown method.
---
drivers/s390/cio/device.c | 10 ++++++++++ drivers/s390/scsi/zfcp_ccw.c | 10 ++++------ include/asm-s390/ccwdev.h | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-)
drivers/s390/cio/device.c +10 -0
@@ -1433,12 +1433,22 @@ ccw_device_remove (struct device *dev)return 0 ; } +static void ccw_device_shutdown (struct device *dev) +{ +struct ccw_device *cdev; + + cdev =to_ccwdev (dev); +if (cdev->drv && cdev->drv->shutdown) + cdev->drv->shutdown (cdev); +} +struct bus_type ccw_bus_type = { .name ="ccw" , .match = ccw_bus_match, .uevent = ccw_uevent, .probe = ccw_device_probe, .remove = ccw_device_remove, + .shutdown = ccw_device_shutdown, };/**
drivers/s390/scsi/zfcp_ccw.c +4 -6
@@ -28,7 +28,7 @@ static void zfcp_ccw_remove(struct ccw_dstatic int zfcp_ccw_set_online (struct ccw_device *);static int zfcp_ccw_set_offline (struct ccw_device *);static int zfcp_ccw_notify (struct ccw_device *,int ); -static void zfcp_ccw_shutdown (struct device *); +static void zfcp_ccw_shutdown (struct ccw_device *);static struct ccw_device_id zfcp_ccw_device_id[] = { {CCW_DEVICE_DEVTYPE(ZFCP_CONTROL_UNIT_TYPE,
@@ -51,9 +51,7 @@ static struct ccw_driver zfcp_ccw_driver .set_online = zfcp_ccw_set_online, .set_offline = zfcp_ccw_set_offline, .notify = zfcp_ccw_notify, - .driver = { - .shutdown = zfcp_ccw_shutdown, - }, + .shutdown = zfcp_ccw_shutdown, };MODULE_DEVICE_TABLE (ccw, zfcp_ccw_device_id);
@@ -277,12 +275,12 @@ zfcp_ccw_register(void)* Makes sure that QDIO queues are down when the system gets stopped. */ static void -zfcp_ccw_shutdown (struct device *dev) +zfcp_ccw_shutdown (struct ccw_device *cdev) {struct zfcp_adapter *adapter;down (&zfcp_data.config_sema); - adapter =dev_get_drvdata (dev); + adapter =dev_get_drvdata (&cdev->dev);zfcp_erp_adapter_shutdown (adapter,0 );zfcp_erp_wait (adapter);up (&zfcp_data.config_sema);
include/asm-s390/ccwdev.h +2 -0
@@ -102,6 +102,7 @@ struct ccw_device {* @set_online: called when setting device online * @set_offline: called when setting device offline * @notify: notify driver of device state changes +* @shutdown: called at device shutdown * @driver: embedded device driver structure * @name: device driver name */
@@ -113,6 +114,7 @@ struct ccw_driver {int (*set_online) (struct ccw_device *);int (*set_offline) (struct ccw_device *);int (*notify) (struct ccw_device *,int ); +void (*shutdown) (struct ccw_device *);struct device_driver driver;char *name; };
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 10/34 cio: Disable channel measurements (cmf) on shutdown/reboot.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
Disable channel measurements for all ccw devices via the ccw bus's shutdown method. Clear residual cmf related information that may be in the schib when setting up a new subchannel.
---
drivers/s390/cio/cio.c | 5 +++++ drivers/s390/cio/device.c | 2 ++ 2 files changed, 7 insertions(+)
drivers/s390/cio/cio.c +5 -0
@@ -619,6 +619,11 @@ cio_validate_subchannel (struct subchann sch->schib.pmcw.ena =0 ;if ((sch->lpm & (sch->lpm -1 )) !=0 ) sch->schib.pmcw.mp =1 ;/* multipath mode */ +/* clean up possible residual cmf stuff */ + sch->schib.pmcw.mme =0 ; + sch->schib.pmcw.mbfc =0 ; + sch->schib.pmcw.mbi =0 ; + sch->schib.mba =0 ;return 0 ; out:if (!cio_is_console (schid))
drivers/s390/cio/device.c +2 -0
@@ -21,6 +21,7 @@#include <asm/ccwdev.h> #include <asm/cio.h> #include <asm/param.h> /* HZ */ +#include <asm/cmb.h> #include "cio.h" #include "cio_debug.h"
@@ -1440,6 +1441,7 @@ static void ccw_device_shutdown(struct d cdev =to_ccwdev (dev);if (cdev->drv && cdev->drv->shutdown) cdev->drv->shutdown (cdev); +disable_cmf (cdev); }struct bus_type ccw_bus_type = {
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 11/34 cio: Fix device attributes for early devices.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
Don't forget to set dev->groups for early ccw devices like the console device so the default attributes are created.
---
drivers/s390/cio/device.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/cio/device.c +1 -0
@@ -1123,6 +1123,7 @@ io_subchannel_probe (struct subchannel ** device, e.g. the console. */ cdev = sch->dev.driver_data; + cdev->dev.groups = ccwdev_attr_groups;device_initialize (&cdev->dev);ccw_device_register (cdev);/*
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 12/34 Add Documentation/s390/00-INDEX.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
---
Documentation/s390/00-INDEX | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
Documentation/s390/00-INDEX new file +26 -0
@@ -0,0 +1,26 @@ +00-INDEX + - this file. +3270.ChangeLog + - ChangeLog for the UTS Global 3270-support patch (outdated). +3270.txt + - how to use the IBM 3270 display system support. +cds.txt + - s390 common device support (common I/O layer). +CommonIO + - common I/O layer command line parameters and /proc entries +config3270.sh + - example configuration for 3270 devices. +DASD + - information on the DASD disk device driver. +Debugging390.txt + - hints for debugging on s390 systems. +driver-model.txt + - information on s390 devices and the driver model. +monreader.txt + - information on accessing the z/VM monitor stream from Linux. +s390dbf.txt + - information on using the s390 debug feature. +TAPE + - information on the driver for channel-attached tapes. +zfcpdump + - information on the s390 SCSI dump tool.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 13/34 cio: Documentation update.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
---
Documentation/s390/00-INDEX | 2 - Documentation/s390/CommonIO | 51 +++++++++++++++++++++++++------------------- Documentation/s390/cds.txt | 8 +++--- 3 files changed, 34 insertions(+), 27 deletions(-)
Documentation/s390/00-INDEX +1 -1
@@ -7,7 +7,7 @@ cds.txt - s390 common device support (common I/O layer). CommonIO - - common I/O layer command line parameters and /proc entries + - common I/O layer command line parameters, procfs and debugfs entries config3270.sh - example configuration for 3270 devices. DASD
Documentation/s390/cds.txt +4 -4
@@ -286,10 +286,10 @@ first: timeout value -EIO: the common I/O layer terminated the request due to an error state -If the concurrent sense flag in the extended status word in the irb is set, the -field irb->scsw.count describes the number of device specific sense bytes -available in the extended control word irb->scsw.ecw[0]. No device sensing by -the device driver itself is required. +If the concurrent sense flag in the extended status word (esw) in the irb is +set, the field erw.scnt in the esw describes the number of device specific +sense bytes available in the extended control word irb->scsw.ecw[]. No device +sensing by the device driver itself is required. The device interrupt handler can use the following definitions to investigate the primary unit check source coded in sense byte 0 :
Documentation/s390/CommonIO +29 -22
82 lines not on this page · raw message
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 14/34 zcrypt: make init/exit functions static.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
---
drivers/s390/crypto/zcrypt_mono.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/crypto/zcrypt_mono.c +2 -2
@@ -45,7 +45,7 @@/** * The module initialization code. */ -int __init zcrypt_init (void ) +static int __init zcrypt_init (void ) {int rc;
@@ -86,7 +86,7 @@ out:/** * The module termination code. */ -void __exit zcrypt_exit(void) +static void __exit zcrypt_exit(void) {zcrypt_cex2a_exit ();zcrypt_pcixcc_exit ();
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 15/34 zcrypt: remove duplicated struct CPRBX definition
In reply to Martin SchwidefskyFrom: Ralph Wuerthner <[email protected]>
---
drivers/s390/crypto/zcrypt_pcixcc.c | 2 - drivers/s390/crypto/zcrypt_pcixcc.h | 45 ------------------------------------ include/asm-s390/zcrypt.h | 4 +-- 3 files changed, 3 insertions(+), 48 deletions(-)
drivers/s390/crypto/zcrypt_pcixcc.c +1 -1
@@ -277,7 +277,7 @@ static int XCRB_msg_to_type6CPRB_msgX(st };struct {struct type6_hdr hdr; -struct ica_CPRBX cprbx; +struct CPRBX cprbx; } __attribute__((packed)) *msg = ap_msg->message;int rcblen =CEIL4 (xcRB->request_control_blk_length);
drivers/s390/crypto/zcrypt_pcixcc.h +0 -45
51 lines not on this page · raw message
include/asm-s390/zcrypt.h +2 -2
@@ -91,7 +91,7 @@ struct ica_rsa_modexpo_crt {* VUD block * key block */ -struct ica_CPRBX { +struct CPRBX {unsigned short cprb_len;/* CPRB length 220 */ unsigned char cprb_ver_id;/* CPRB version id. 0x02 */ unsigned char pad_000[3 ];/* Alignment pad bytes */
@@ -130,7 +130,7 @@ struct ica_CPRBX {unsigned char cntrl_domain[4 ];/* Control domain */ unsigned char S390enf_mask[4 ];/* S/390 enforcement mask */ unsigned char pad_004[36 ];/* reserved */ -}; +} __attribute__((packed));/** * xcRB
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 16/34 zcrypt: fix ap_reset_domain()
In reply to Martin SchwidefskyFrom: Ralph Wuerthner <[email protected]>
Resetting of a all queues within a domain requires that a domain must be selected first.
---
drivers/s390/crypto/ap_bus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/s390/crypto/ap_bus.c +3 -2
@@ -1231,8 +1231,9 @@ static void ap_reset_domain(void) {int i; -for (i =0 ; i <AP_DEVICES ; i++) -ap_reset_queue (AP_MKQID (i, ap_domain_index)); +if (ap_domain_index !=-1 ) +for (i =0 ; i <AP_DEVICES ; i++) +ap_reset_queue (AP_MKQID (i, ap_domain_index)); }static void ap_reset_all (void )
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 17/34 appldata_base: Misc cpuinit annotations and bugfix
In reply to Martin SchwidefskyFrom: Satyam Sharma <[email protected]>
appldata_offline_cpu() is only called from __cpuinit-marked hotplug notifier callback and from the __exit-marked module_exit function, therefore candidate for __cpuexit.
BTW the __exit module_exit function appldata_exit() of this driver fails to unregister_hotcpu_notifier() the notifier_block that was registered by appldata_init() during module startup. This will lead to oops if hotplug notification comes after module has been unloaded. Let's fix this by unregistering the notifier appropriately (before appldata_offline_cpu()'ing the CPUs).
---
arch/s390/appldata/appldata_base.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
arch/s390/appldata/appldata_base.c +6 -5
@@ -547,8 +547,7 @@ static void __cpuinit appldata_online_cpspin_unlock (&appldata_timer_lock); } -static void -appldata_offline_cpu (int cpu) +static void __cpuexit appldata_offline_cpu(int cpu) {del_virt_timer (&per_cpu (appldata_timer, cpu));if (atomic_dec_and_test (&appldata_expire_count)) {
@@ -560,9 +559,9 @@ appldata_offline_cpu(int cpu)spin_unlock (&appldata_timer_lock); } -static int __cpuinit -appldata_cpu_notify (struct notifier_block *self, -unsigned long action,void *hcpu) +static int __cpuinit appldata_cpu_notify (struct notifier_block *self, +unsigned long action, +void *hcpu) {switch (action) {case CPU_ONLINE :
@@ -646,6 +645,8 @@ static void __exit appldata_exit(void) }spin_unlock (&appldata_ops_lock); +unregister_hotcpu_notifier (&appldata_nb); +for_each_online_cpu (i)appldata_offline_cpu (i);
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 18/34 appldata_base: Remove module_exit function and modular stuff
In reply to Martin SchwidefskyFrom: Satyam Sharma <[email protected]>
arch/s390/Kconfig tells us that CONFIG_APPLDATA_BASE is bool and hence can never be built modular. Given this, defining appldata_exit() function is pointless (and wasteful, actually). Remove all that.
Previous patch annotated appldata_offline_cpu() as __cpuexit, but now with the __exit function appldata_exit() gone, the only callsite that references it is __cpuinit, so this function can also be __cpuinit, thereby saving space when HOTPLUG_CPU=n.
---
arch/s390/appldata/appldata_base.c | 54 +------------------------------------ 1 file changed, 2 insertions(+), 52 deletions(-)
arch/s390/appldata/appldata_base.c +2 -52
@@ -547,7 +547,7 @@ static void __cpuinit appldata_online_cpspin_unlock (&appldata_timer_lock); } -static void __cpuexit appldata_offline_cpu(int cpu) +static void __cpuinit appldata_offline_cpu (int cpu) {del_virt_timer (&per_cpu (appldata_timer, cpu));if (atomic_dec_and_test (&appldata_expire_count)) {
@@ -607,65 +607,15 @@ static int __init appldata_init(void)register_hotcpu_notifier (&appldata_nb); appldata_sysctl_header =register_sysctl_table (appldata_dir_table); -#ifdef MODULE - appldata_dir_table[0 ].de->owner =THIS_MODULE ; - appldata_table[0 ].de->owner =THIS_MODULE ; - appldata_table[1 ].de->owner =THIS_MODULE ; -#endif P_DEBUG ("Base interface initialized.\n" );return 0 ; } -/* -* appldata_exit() -* -* stop timer, unregister /proc entries -*/ -static void __exit appldata_exit(void) -{ -struct list_head *lh; -struct appldata_ops *ops; -int rc, i; - -P_DEBUG ("Unloading module ...\n" ); -/* -* ops list should be empty, but just in case something went wrong... -*/ -spin_lock (&appldata_ops_lock); -list_for_each (lh, &appldata_ops_list) { - ops = list_entry(lh, struct appldata_ops, list); - rc =appldata_diag (ops->record_nr,APPLDATA_STOP_REC , - (unsigned long ) ops->data, ops->size, - ops->mod_lvl); -if (rc !=0 ) { -P_ERROR ("STOP DIAG 0xDC for %s failed, " -"return code: %d\n" , ops->name, rc); - } - } -spin_unlock (&appldata_ops_lock); - -unregister_hotcpu_notifier (&appldata_nb); +__initcall (appldata_init); -for_each_online_cpu (i) -appldata_offline_cpu (i); - - appldata_timer_active =0 ; - -unregister_sysctl_table (appldata_sysctl_header); - -destroy_workqueue (appldata_wq); -P_DEBUG ("... module unloaded!\n" ); -}/**************************** init / exit <END> ******************************/ - -module_init (appldata_init); -module_exit (appldata_exit); -MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Gerald Schaefer" ); -MODULE_DESCRIPTION ("Linux-VM Monitor Stream, base infrastructure" ); -EXPORT_SYMBOL_GPL (appldata_register_ops);EXPORT_SYMBOL_GPL (appldata_unregister_ops);EXPORT_SYMBOL_GPL (appldata_diag);
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 19/34 disassembler: fix output for insns with 6 operands.
In reply to Martin SchwidefskyFrom: Martin Schwidefsky <[email protected]>
The termination condition of the loop that prints the operands of an instruction doesn't stop after the maximum of 6 operands. It continues with the operands of the next instruction format instead which create really long lines.
---
arch/s390/kernel/dis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/s390/kernel/dis.c +3 -1
@@ -1162,6 +1162,7 @@ static int print_insn(char *buffer, unsiunsigned int value;char separator;char *ptr; +int i; ptr = buffer; insn =find_insn (code);
@@ -1169,7 +1170,8 @@ static int print_insn(char *buffer, unsi ptr +=sprintf (ptr,"%.5s\t" , insn->name);/* Extract the operands. */ separator =0 ; -for (ops = formats[insn->format] +1 ; *ops !=0 ; ops++) { +for (ops = formats[insn->format] +1 , i =0 ; + *ops !=0 && i <6 ; ops++, i++) { operand = operands + *ops; value =extract_operand (code, operand);if ((operand->flags &OPERAND_INDEX ) && value ==0 )
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 20/34 disassembler: Remove redundant variable assignment
In reply to Martin SchwidefskyFrom: Christian Borntraeger <[email protected]>
There is no need to assign "0" to "hops" twice. Remove one assigment.
---
arch/s390/kernel/dis.c | 1 - 1 file changed, 1 deletion(-)
arch/s390/kernel/dis.c +0 -1
@@ -1243,7 +1243,6 @@ void show_code(struct pt_regs *regs) }/* Find a starting point for the disassembly. */ while (start <32 ) { - hops =0 ;for (i =0 , hops =0 ; start + i <32 && hops <3 ; hops++) {if (!find_insn (code + start + i))break ;
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 21/34 Get rid of a bunch of sparse warnings again.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
Also removes a bunch of ^L in drivers/s390/cio/cmf.c
---
arch/s390/kernel/audit.c | 7 +------ arch/s390/kernel/audit.h | 15 +++++++++++++++ arch/s390/kernel/compat_audit.c | 1 + drivers/s390/char/con3270.c | 3 +-- drivers/s390/char/sclp.c | 5 ++--- drivers/s390/char/tty3270.c | 9 ++++++--- drivers/s390/char/tty3270.h | 16 ++++++++++++++++ drivers/s390/cio/chp.c | 8 ++++++-- drivers/s390/cio/cmf.c | 4 +--- drivers/s390/scsi/zfcp_dbf.c | 10 +++++----- drivers/s390/scsi/zfcp_erp.c | 18 ++++++++---------- 11 files changed, 62 insertions(+), 34 deletions(-)
arch/s390/kernel/audit.c +1 -6
@@ -2,6 +2,7 @@#include <linux/types.h> #include <linux/audit.h> #include <asm/unistd.h> +#include "audit.h" static unsigned dir_class[] = {#include <asm-generic/audit_dir_write.h>
@@ -40,7 +41,6 @@ int audit_classify_arch(int arch)int audit_classify_syscall (int abi,unsigned syscall) {#ifdef CONFIG_COMPAT -extern int s390_classify_syscall (unsigned );if (abi ==AUDIT_ARCH_S390 )return s390_classify_syscall (syscall);#endif
@@ -61,11 +61,6 @@ int audit_classify_syscall(int abi, unsistatic int __init audit_classes_init (void ) {#ifdef CONFIG_COMPAT -extern __u32 s390_dir_class[]; -extern __u32 s390_write_class[]; -extern __u32 s390_read_class[]; -extern __u32 s390_chattr_class[]; -extern __u32 s390_signal_class[];audit_register_class (AUDIT_CLASS_WRITE_32 , s390_write_class);audit_register_class (AUDIT_CLASS_READ_32 , s390_read_class);audit_register_class (AUDIT_CLASS_DIR_WRITE_32 , s390_dir_class);
arch/s390/kernel/audit.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef __ARCH_S390_KERNEL_AUDIT_H +#define __ARCH_S390_KERNEL_AUDIT_H + +#include <linux/types.h> + +#ifdef CONFIG_COMPAT +extern int s390_classify_syscall (unsigned ); +extern __u32 s390_dir_class[]; +extern __u32 s390_write_class[]; +extern __u32 s390_read_class[]; +extern __u32 s390_chattr_class[]; +extern __u32 s390_signal_class[]; +#endif /* CONFIG_COMPAT */ + +#endif /* __ARCH_S390_KERNEL_AUDIT_H */
arch/s390/kernel/compat_audit.c +1 -0
@@ -1,5 +1,6 @@#undef __s390x__#include <asm/unistd.h> +#include "audit.h" unsigned s390_dir_class[] = {#include <asm-generic/audit_dir_write.h>
drivers/s390/char/con3270.c +1 -2
@@ -22,6 +22,7 @@#include <asm/ebcdic.h> #include "raw3270.h" +#include "tty3270.h" #include "ctrlchar.h" #define CON3270_OUTPUT_BUFFER_SIZE 1024
@@ -507,8 +508,6 @@ con3270_write(struct console *co, constspin_unlock_irqrestore (&cp->view.lock,flags); } -extern struct tty_driver *tty3270_driver; -static struct tty_driver *con3270_device (struct console *c,int *index) {
drivers/s390/char/sclp.c +2 -3
@@ -93,6 +93,7 @@ static volatile enum sclp_mask_state_t {#define SCLP_RETRY_INTERVAL 30static void sclp_process_queue (void ); +static void __sclp_make_read_req (void );static int sclp_init_mask (int calculate);static int sclp_init (void );
@@ -115,7 +116,6 @@ sclp_service_call(sclp_cmdw_t command, vreturn 0 ; } -static inline void __sclp_make_read_req (void );static void __sclp_queue_read_req (void )
@@ -318,8 +318,7 @@ sclp_read_cb(struct sclp_req *req, void }/* Prepare read event data request. Called while sclp_lock is locked. */ -static inline void -__sclp_make_read_req (void ) +static void __sclp_make_read_req (void ) {struct sccb_header *sccb;
drivers/s390/char/tty3270.c +6 -3
@@ -25,8 +25,8 @@#include <asm/ebcdic.h> #include <asm/uaccess.h> -#include "raw3270.h" +#include "tty3270.h" #include "keyboard.h" #define TTY3270_CHAR_BUF_SIZE 256
@@ -1338,8 +1338,11 @@ tty3270_getpar(struct tty3270 *tp, int istatic void tty3270_goto_xy (struct tty3270 *tp,int cx,int cy) { - tp->cx =min_t (int, tp->view.cols -1 ,max_t (int,0 , cx)); - cy =min_t (int, tp->view.rows -3 ,max_t (int,0 , cy)); +int max_cx =max (0 , cx); +int max_cy =max (0 , cy); + + tp->cx =min_t (int, tp->view.cols -1 , max_cx); + cy =min_t (int, tp->view.rows -3 , max_cy);if (cy != tp->cy) {tty3270_convert_line (tp, tp->cy); tp->cy = cy;
drivers/s390/char/tty3270.h new file +16 -0
@@ -0,0 +1,16 @@ +/* +* drivers/s390/char/tty3270.h +* +* Copyright IBM Corp. 2007 +* +*/ + +#ifndef __DRIVERS_S390_CHAR_TTY3270_H +#define __DRIVERS_S390_CHAR_TTY3270_H + +#include <linux/tty.h> +#include <linux/tty_driver.h> + +extern struct tty_driver *tty3270_driver; + +#endif /* __DRIVERS_S390_CHAR_TTY3270_H */
drivers/s390/cio/chp.c +6 -2
@@ -140,9 +140,11 @@ static ssize_t chp_measurement_chars_rea char *buf, loff_t off, size_t count) {struct channel_path *chp; +struct device *device;unsigned int size; - chp = to_channelpath(container_of(kobj, struct device, kobj)); + device = container_of(kobj, struct device, kobj); + chp =to_channelpath (device);if (!chp->cmg_chars)return 0 ;
@@ -193,9 +195,11 @@ static ssize_t chp_measurement_read(stru {struct channel_path *chp;struct channel_subsystem *css; +struct device *device;unsigned int size; - chp = to_channelpath(container_of(kobj, struct device, kobj)); + device = container_of(kobj, struct device, kobj); + chp =to_channelpath (device); css =to_css (chp->dev.parent); size =sizeof (struct cmg_entry );
drivers/s390/cio/cmf.c +1 -3
@@ -489,7 +489,6 @@ static struct cmb_area cmb_area = { .num_channels = 1024, }; -/* ****** old style CMB handling ********/ /*
@@ -812,7 +811,7 @@ static struct cmb_operations cmbops_basi .align = align_cmb, .attr_group = &cmf_attr_group, }; - +/* ******** extended cmb handling ********/ /**
@@ -1079,7 +1078,6 @@ static struct cmb_operations cmbops_exte .align = align_cmbe, .attr_group = &cmf_attr_group_ext, }; -static ssize_t cmb_show_attr (struct device *dev,char *buf,enum cmb_index idx) {
drivers/s390/scsi/zfcp_dbf.c +5 -5
@@ -19,8 +19,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <asm/debug.h> #include <linux/ctype.h> +#include <asm/debug.h> #include "zfcp_ext.h" static u32 dbfsize =4 ;
@@ -35,17 +35,17 @@ static int zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck) {unsigned long long sec; -struct timespec xtime; +struct timespec dbftime;int len =0 ; stck -=0x8126d60e46000000LL - (0x3c26700LL *1000000 *4096 ); sec = stck >>12 ;do_div (sec,1000000 ); - xtime.tv_sec = sec; + dbftime.tv_sec = sec; stck -= (sec *1000000 ) <<12 ; - xtime.tv_nsec = ((stck *1000 ) >>12 ); + dbftime.tv_nsec = ((stck *1000 ) >>12 ); len +=sprintf (out_buf + len,"%-24s%011lu:%06lu\n" , - label, xtime.tv_sec, xtime.tv_nsec); + label, dbftime.tv_sec, dbftime.tv_nsec);return len; }
drivers/s390/scsi/zfcp_erp.c +8 -10
@@ -54,7 +54,7 @@ static int zfcp_erp_strategy_check_adaptstatic int zfcp_erp_strategy_statechange (int ,u32 ,struct zfcp_adapter *,struct zfcp_port *,struct zfcp_unit *,int ); -static inline int zfcp_erp_strategy_statechange_detected (atomic_t *,u32 ); +static int zfcp_erp_strategy_statechange_detected (atomic_t *,u32 );static int zfcp_erp_strategy_followup_actions (int ,struct zfcp_adapter *,struct zfcp_port *,struct zfcp_unit *,int );
@@ -106,8 +106,8 @@ static void zfcp_erp_action_cleanup(int,static void zfcp_erp_action_ready (struct zfcp_erp_action *);static int zfcp_erp_action_exists (struct zfcp_erp_action *); -static inline void zfcp_erp_action_to_ready (struct zfcp_erp_action *); -static inline void zfcp_erp_action_to_running (struct zfcp_erp_action *); +static void zfcp_erp_action_to_ready (struct zfcp_erp_action *); +static void zfcp_erp_action_to_running (struct zfcp_erp_action *);static void zfcp_erp_memwait_handler (unsigned long );
@@ -952,7 +952,7 @@ zfcp_erp_memwait_handler(unsigned long d* action gets an appropriate flag and will be processed * accordingly */ -void zfcp_erp_timeout_handler (unsigned long data) +static void zfcp_erp_timeout_handler (unsigned long data) {struct zfcp_erp_action *erp_action = (struct zfcp_erp_action *) data;struct zfcp_adapter *adapter = erp_action->adapter;
@@ -1491,7 +1491,7 @@ zfcp_erp_strategy_statechange(int actionreturn retval; } -static inline int +static int zfcp_erp_strategy_statechange_detected (atomic_t * target_status,u32 erp_status) {return
@@ -2001,7 +2001,7 @@ zfcp_erp_adapter_strategy_generic(struct* returns: 0 - successful setup * !0 - failed setup */ -int +static int zfcp_erp_adapter_strategy_open_qdio (struct zfcp_erp_action *erp_action) {int retval;
@@ -3248,8 +3248,7 @@ static void zfcp_erp_action_dismiss_unitzfcp_erp_action_dismiss (&unit->erp_action); } -static inline void -zfcp_erp_action_to_running (struct zfcp_erp_action *erp_action) +static void zfcp_erp_action_to_running (struct zfcp_erp_action *erp_action) {struct zfcp_adapter *adapter = erp_action->adapter;
@@ -3258,8 +3257,7 @@ zfcp_erp_action_to_running(struct zfcp_elist_move (&erp_action->list, &erp_action->adapter->erp_running_head); } -static inline void -zfcp_erp_action_to_ready (struct zfcp_erp_action *erp_action) +static void zfcp_erp_action_to_ready (struct zfcp_erp_action *erp_action) {struct zfcp_adapter *adapter = erp_action->adapter;
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 22/34 remove packed attribute from ext_int_info_t.
In reply to Martin SchwidefskyFrom: Christian Borntraeger <[email protected]>
ext_int_info_t is no longer used in entry(64).S Instead do_extint is a C function that handles the hash search.
As the structure is handled in C code, we can also remove the packed attribute to avoid alignment issues. (Currently there is no alignment problem in ext_int_info_t, even if packet)
---
include/asm-s390/s390_ext.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
include/asm-s390/s390_ext.h +2 -6
@@ -5,7 +5,7 @@* include/asm-s390/s390_ext.h * * S390 version -* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation +* Copyright IBM Corp. 1999,2007 * Author(s): Holger Smolinski ([email protected]), * Martin Schwidefsky ([email protected]) */
@@ -14,15 +14,11 @@typedef void (*ext_int_handler_t )(__u16 code); -/* -* Warning: if you change ext_int_info_t you have to change the -* external interrupt handler in entry.S too. -*/ typedef struct ext_int_info_t {struct ext_int_info_t *next;ext_int_handler_t handler;__u16 code; -} __attribute__ ((packed))ext_int_info_t ; +}ext_int_info_t ;extern ext_int_info_t *ext_int_hash[];
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 23/34 Get rid of ARCH_KMALLOC_MINALIGN.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
slab cache debugging code has been changed so that we always get a minimum alignment of the alignment of a 64-integer. Since this is 8 on s390/s390x there is no need of ARCH_KMALLOC_MINALIGN anymore.
---
include/asm-s390/cache.h | 2 -- 1 file changed, 2 deletions(-)
include/asm-s390/cache.h +0 -2
@@ -14,8 +14,6 @@#define L1_CACHE_BYTES 256#define L1_CACHE_SHIFT 8 -#define ARCH_KMALLOC_MINALIGN 8 -#define __read_mostly __attribute__((__section__(".data.read_mostly")))#endif
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 24/34 qdio: dont cast function pointers and use them to call functions.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
According to C99 6.3.2.3 it's undefined what happens if a converted pointer is used to call a function whose type is not compatible with the pointed-to type.
That's what the qdio code is doing, so fix it.
---
drivers/s390/cio/qdio.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-)
drivers/s390/cio/qdio.c +19 -18
@@ -1024,9 +1024,9 @@ __qdio_outbound_processing(struct qdio_q }static void -qdio_outbound_processing (struct qdio_q *q) +qdio_outbound_processing (unsigned long q) { -__qdio_outbound_processing (q); +__qdio_outbound_processing ((struct qdio_q *) q); }/************************* INBOUND ROUTINES *******************************/
@@ -1449,9 +1449,10 @@ out: }static void -tiqdio_inbound_processing (struct qdio_q *q) +tiqdio_inbound_processing (unsigned long q) { -__tiqdio_inbound_processing (q,atomic_read (&spare_indicator_usecount)); +__tiqdio_inbound_processing ((struct qdio_q *) q, +atomic_read (&spare_indicator_usecount)); } static void
@@ -1494,9 +1495,9 @@ again: }static void -qdio_inbound_processing (struct qdio_q *q) +qdio_inbound_processing (unsigned long q) { -__qdio_inbound_processing (q); +__qdio_inbound_processing ((struct qdio_q *) q); }/************************* MAIN ROUTINES *******************************/
@@ -1760,12 +1761,15 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, s q->handler=input_handler; q->dev_st_chg_ind=irq_ptr->dev_st_chg_ind; - q->tasklet.data=(unsigned long )q;/* q->is_thinint_q isn't valid at this time, but -* irq_ptr->is_thinint_irq is */ - q->tasklet.func=(void (*)(unsigned long )) - ((irq_ptr->is_thinint_irq)?&tiqdio_inbound_processing: - &qdio_inbound_processing); +* irq_ptr->is_thinint_irq is +*/ +if (irq_ptr->is_thinint_irq) +tasklet_init (&q->tasklet, tiqdio_inbound_processing, + (unsigned long ) q); +else +tasklet_init (&q->tasklet, qdio_inbound_processing, + (unsigned long ) q);/* actually this is not used for inbound queues. yet. */ atomic_set (&q->busy_siga_counter,0 );
@@ -1836,13 +1840,10 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, s q->last_move_ftc=0 ; q->handler=output_handler; - q->tasklet.data=(unsigned long )q; - q->tasklet.func=(void (*)(unsigned long )) - &qdio_outbound_processing; - q->timer.function=(void (*)(unsigned long )) - &qdio_outbound_processing; - q->timer.data = (long )q; -init_timer (&q->timer); +tasklet_init (&q->tasklet, qdio_outbound_processing, + (unsigned long ) q); +setup_timer (&q->timer, qdio_outbound_processing, + (unsigned long ) q);atomic_set (&q->busy_siga_counter,0 ); q->timing.busy_start=0 ;
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 25/34 is_power_of_2 in drivers/s390/block/dasd_int.h
In reply to Martin SchwidefskyFrom: vignesh babu <[email protected]>
Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)
---
drivers/s390/block/dasd_int.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/block/dasd_int.h +2 -1
@@ -53,6 +53,7 @@#include <linux/genhd.h> #include <linux/hdreg.h> #include <linux/interrupt.h> +#include <linux/log2.h> #include <asm/ccwdev.h> #include <linux/workqueue.h> #include <asm/debug.h>
@@ -456,7 +457,7 @@ dasd_free_chunk(struct list_head *chunk_static inline int dasd_check_blocksize (int bsize) { -if (bsize <512 || bsize >4096 || (bsize & (bsize -1 )) !=0 ) +if (bsize <512 || bsize >4096 || !is_power_of_2 (bsize))return -EMEDIUMTYPE ;return 0 ; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 26/34 qdio: change QDIO performance_stats error message priority
In reply to Martin SchwidefskyFrom: Ursula Braun <[email protected]>
---
drivers/s390/cio/qdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/cio/qdio.c +1 -1
@@ -3727,7 +3727,7 @@ qdio_performance_stats_store(struct bus_#endif /* CONFIG_64BIT */ } }else { -QDIO_PRINT_WARN ("QDIO performance_stats: write 0 or 1 to this file!\n" ); +QDIO_PRINT_ERR ("QDIO performance_stats: write 0 or 1 to this file!\n" );return -EINVAL ; }return count;
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 27/34 Force link error if xchg/cmpxchg gets called with unsupported size.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
---
include/asm-s390/system.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
include/asm-s390/system.h +13 -11
@@ -130,6 +130,8 @@ extern void pfault_fini(void); __ret; \ }) +extern void __xchg_called_with_bad_pointer (void ); +static inline unsigned long __xchg (unsigned long x,void * ptr,int size) {unsigned long addr, old;
@@ -150,8 +152,7 @@ static inline unsigned long __xchg(unsig : "=&d" (old), "=m" (*(int *) addr) : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), "m" (*(int *) addr) : "memory", "cc", "0"); - x = old >> shift; -break ; +return old >> shift;case 2 : addr = (unsigned long ) ptr; shift = (2 ^ (addr &2 )) <<3 ;
@@ -166,8 +167,7 @@ static inline unsigned long __xchg(unsig : "=&d" (old), "=m" (*(int *) addr) : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), "m" (*(int *) addr) : "memory", "cc", "0"); - x = old >> shift; -break ; +return old >> shift;case 4 : asmvolatile ( " l %0,0(%3)\n"
@@ -176,8 +176,7 @@ static inline unsigned long __xchg(unsig : "=&d" (old), "=m" (*(int *) ptr) : "d" (x), "a" (ptr), "m" (*(int *) ptr) : "memory", "cc"); - x = old; -break ; +return old;#ifdef __s390x__case 8 : asm volatile(
@@ -187,11 +186,11 @@ static inline unsigned long __xchg(unsig : "=&d" (old), "=m" (*(long *) ptr) : "d" (x), "a" (ptr), "m" (*(long *) ptr) : "memory", "cc"); - x = old; -break ; +return old;#endif /* __s390x__ */ - } -return x; + } +__xchg_called_with_bad_pointer (); +return x; }/*
@@ -206,6 +205,8 @@ static inline unsigned long __xchg(unsig ((__typeof__ (*(ptr )))__cmpxchg ((ptr),(unsigned long )(o),\ (unsigned long)(n),sizeof(*(ptr)))) +extern void __cmpxchg_called_with_bad_pointer (void ); +static inline unsigned long __cmpxchg (volatile void *ptr,unsigned long old,unsigned long new,int size) {
@@ -270,7 +271,8 @@ __cmpxchg(volatile void *ptr, unsigned lreturn prev;#endif /* __s390x__ */ } -return old; +__cmpxchg_called_with_bad_pointer (); +return old; }/*
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 28/34 Use IPL CLEAR for reipl under z/VM
In reply to Martin SchwidefskyFrom: Michael Holzheu <[email protected]>
If we use the CLEAR ipl option, reipl is faster, since then VM can release the memory, which has been paged out.
---
arch/s390/kernel/ipl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/ipl.c +2 -2
@@ -735,10 +735,10 @@ void do_reipl(void)case REIPL_METHOD_CCW_VM :reipl_get_ascii_loadparm (loadparm);if (strlen (loadparm) ==0 ) -sprintf (buf,"IPL %X" , +sprintf (buf,"IPL %X CLEAR" , reipl_block_ccw->ipl_info.ccw.devno);else -sprintf (buf,"IPL %X LOADPARM '%s'" , +sprintf (buf,"IPL %X CLEAR LOADPARM '%s'" , reipl_block_ccw->ipl_info.ccw.devno, loadparm);__cpcmd (buf,NULL ,0 ,NULL );break ;
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 29/34 Remove obsolete recommendation for 8M ramdisk size.
In reply to Martin SchwidefskyFrom: Robert P. J. Day <[email protected]>
---
drivers/block/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/Kconfig +1 -2
@@ -361,8 +361,7 @@ config BLK_DEV_RAM_SIZE default "4096" help The default value is 4096 kilobytes. Only change this if you know - what are you doing. If you are using IBM S/390, then set this to - 8192. + what are you doing. config BLK_DEV_RAM_BLOCKSIZE int "Default RAM disk block size (bytes)"
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 30/34 zcore: fix inline assembly in memcpy_real()
In reply to Martin SchwidefskyFrom: Michael Holzheu <[email protected]>
memcpy_real uses the mvcle instruction. This instruction alters all used registers (source, destination and 2 x count). Therefore we have to flag those registers as input/output registers (+d). In addition to that, we have to specify, that we read from memory designated by "src" and write to memory designated by "dest".
---
drivers/s390/char/zcore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/s390/char/zcore.c +4 -3
@@ -141,15 +141,16 @@ static int memcpy_real(void *dest, unsigif (count ==0 )return 0 ; - flags =__raw_local_irq_stnsm (0xf8 );/* switch to real mode */ + flags =__raw_local_irq_stnsm (0xf8UL );/* switch to real mode */ asmvolatile ("0: mvcle %1,%2,0x0\n" "1: jo 0b\n" " lhi %0,0x0\n" "2:\n" EX_TABLE(1b,2b) - : "+d" (rc) - : "d" (_dest), "d" (_src), "d" (_len1), "d" (_len2) + : "+d" (rc), "+d" (_dest), "+d" (_src), "+d" (_len1), + "+d" (_len2), "=m" (*((long*)dest)) + : "m" (*((long*)src)) : "cc", "memory"); __raw_local_irq_ssm(flags);
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 31/34 Make vmalloc area start at address > 4GB.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
Prevent that modules get loaded at addresses below 4GB to prevent exchanging system call table entries.
---
include/asm-s390/pgtable.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
include/asm-s390/pgtable.h +10 -3
@@ -107,11 +107,18 @@ extern char empty_zero_page[PAGE_SIZE];* any out-of-bounds memory accesses will hopefully be caught. * The vmalloc() routines leaves a hole of 4kB between each vmalloced * area for the same reason. ;) +* vmalloc area starts at 4GB to prevent syscall table entry exchanging +* from modules. */ extern unsigned long vmalloc_end; -#define VMALLOC_OFFSET (8*1024*1024) -#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ - & ~(VMALLOC_OFFSET-1)) + +#ifdef CONFIG_64BIT +#define VMALLOC_ADDR (max(0x100000000UL, (unsigned long) high_memory)) +#else +#define VMALLOC_ADDR ((unsigned long) high_memory) +#endif +#define VMALLOC_OFFSET (8*1024*1024) +#define VMALLOC_START ((VMALLOC_ADDR + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))#define VMALLOC_END vmalloc_end/*
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 32/34 cpcmd: fix inline assembly usage.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
After assigning values to specific registers memset was called. This may clobber the contents of the used registers.
To solve this extract the two used inline assemblies into small functions that don't call any functions.
---
arch/s390/kernel/cpcmd.c | 100 +++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 45 deletions(-)
arch/s390/kernel/cpcmd.c +55 -45
@@ -2,7 +2,7 @@* arch/s390/kernel/cpcmd.c * * S390 version -* Copyright (C) 1999,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation +* Copyright IBM Corp. 1999,2007 * Author(s): Martin Schwidefsky ([email protected]), * Christian Borntraeger ([email protected]), */
@@ -21,6 +21,49 @@static DEFINE_SPINLOCK (cpcmd_lock);static char cpcmd_buf[241 ]; +static int diag8_noresponse (int cmdlen) +{ + register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; + register unsigned long reg3 asm ("3") = cmdlen; + + asmvolatile ( +#ifndef CONFIG_64BIT + " diag %1,%0,0x8\n" +#else /* CONFIG_64BIT */ +" sam31\n" +" diag %1,%0,0x8\n" +" sam64\n" +#endif /* CONFIG_64BIT */ + :"+d" (reg3) :"d" (reg2) :"cc" ); +return reg3; +} + +static int diag8_response (int cmdlen,char *response,int *rlen) +{ + register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; + register unsigned long reg3 asm ("3") = (addr_t) response; + register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; + register unsigned long reg5 asm ("5") = *rlen; + + asmvolatile ( +#ifndef CONFIG_64BIT + " diag %2,%0,0x8\n" + " brc 8,1f\n" + " ar %1,%4\n" +#else /* CONFIG_64BIT */ + " sam31\n" + " diag %2,%0,0x8\n" + " sam64\n" + " brc 8,1f\n" + " agr %1,%4\n" +#endif /* CONFIG_64BIT */ +"1:\n" + :"+d" (reg4),"+d" (reg5) + :"d" (reg2),"d" (reg3),"d" (*rlen) :"cc" ); + *rlen = reg5; +return reg4; +} +/* * __cpcmd has some restrictions over cpcmd * - the response buffer must reside below 2GB (if any)
@@ -28,59 +71,27 @@ static char cpcmd_buf[241];*/ int __cpcmd (const char *cmd,char *response,int rlen,int *response_code) { -unsigned cmdlen; -int return_code, return_len; +int cmdlen; +int rc; +int response_len; cmdlen =strlen (cmd);BUG_ON (cmdlen >240 );memcpy (cpcmd_buf, cmd, cmdlen);ASCEBC (cpcmd_buf, cmdlen); -if (response !=NULL && rlen >0 ) { - register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; - register unsigned long reg3 asm ("3") = (addr_t) response; - register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; - register unsigned long reg5 asm ("5") = rlen; - +if (response) {memset (response,0 , rlen); - asmvolatile ( -#ifndef CONFIG_64BIT - " diag %2,%0,0x8\n" - " brc 8,1f\n" - " ar %1,%4\n" -#else /* CONFIG_64BIT */ - " sam31\n" - " diag %2,%0,0x8\n" - " sam64\n" - " brc 8,1f\n" - " agr %1,%4\n" -#endif /* CONFIG_64BIT */ -"1:\n" - :"+d" (reg4),"+d" (reg5) - :"d" (reg2),"d" (reg3),"d" (rlen) :"cc" ); - return_code = (int ) reg4; - return_len = (int ) reg5; -EBCASC (response, rlen); + response_len = rlen; + rc =diag8_response (cmdlen, response, &rlen); +EBCASC (response, response_len); }else { - register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; - register unsigned long reg3 asm ("3") = cmdlen; - return_len =0 ; - asmvolatile ( -#ifndef CONFIG_64BIT - " diag %1,%0,0x8\n" -#else /* CONFIG_64BIT */ -" sam31\n" -" diag %1,%0,0x8\n" -" sam64\n" -#endif /* CONFIG_64BIT */ - :"+d" (reg3) :"d" (reg2) :"cc" ); - return_code = (int ) reg3; + rc =diag8_noresponse (cmdlen); } -if (response_code !=NULL ) - *response_code = return_code; -return return_len; +if (response_code) + *response_code = rc; +return rlen; } -EXPORT_SYMBOL (__cpcmd);int cpcmd (const char *cmd,char *response,int rlen,int *response_code)
@@ -109,5 +120,4 @@ int cpcmd(const char *cmd, char *respons }return len; } -EXPORT_SYMBOL (cpcmd);
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 33/34 tape: Fix medium state handling
In reply to Martin SchwidefskyFrom: Michael Holzheu <[email protected]>
Currently there are situations, where the tape medium state (loaded, unloaded, unknown) is not set correctly. The reason is that the medium association field is used to determine the medium state. This not always leads to correct results. To fix that we use another field of the medium sense data instead.
---
drivers/s390/char/tape_3590.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-)
drivers/s390/char/tape_3590.c +17 -9
@@ -713,16 +713,22 @@ static void tape_3590_med_state_set(stru c_info = &TAPE_3590_CRYPT_INFO (device); -if (sense->masst ==MSENSE_UNASSOCIATED ) { +DBF_EVENT (6 ,"medium state: %x:%x\n" , sense->macst, sense->masst); +switch (sense->macst) { +case 0x04 : +case 0x05 : +case 0x06 :tape_med_state_set (device,MS_UNLOADED );TAPE_3590_CRYPT_INFO (device).medium_status =0 ;return ; - } -if (sense->masst !=MSENSE_ASSOCIATED_MOUNT ) { -PRINT_ERR ("Unknown medium state: %x\n" , sense->masst); +case 0x08 : +case 0x09 : +tape_med_state_set (device,MS_LOADED ); +break ; +default : +tape_med_state_set (device,MS_UNKNOWN );return ; } -tape_med_state_set (device,MS_LOADED ); c_info->medium_status |=TAPE390_MEDIUM_LOADED_MASK ;if (sense->flags &MSENSE_CRYPT_MASK ) {PRINT_INFO ("Medium is encrypted (%04x)\n" , sense->flags);
@@ -840,15 +846,17 @@ tape_3590_unsolicited_irq(struct tape_de/* Probably result of halt ssch */ return TAPE_IO_PENDING ; else if (irb->scsw.dstat == 0x85) -/* Device Ready -> check medium state */ - tape_3590_schedule_work(device, TO_MSEN); - else if (irb->scsw.dstat & DEV_STAT_ATTENTION) + /* Device Ready */ + DBF_EVENT(3, "unsol.irq! tape ready: %08x\n", device->cdev_id); + else if (irb->scsw.dstat & DEV_STAT_ATTENTION) {tape_3590_schedule_work (device,TO_READ_ATTMSG ); - else { + } else {DBF_EVENT (3 ,"unsol.irq! dev end: %08x\n" , device->cdev_id);PRINT_WARN ("Unsolicited IRQ (Device End) caught.\n" );tape_dump_sense (device,NULL , irb); } +/* check medium state */ +tape_3590_schedule_work (device,TO_MSEN );return TAPE_IO_SUCCESS ; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 34/34 vmwatchdog: fix broken inline assembly.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
Constraint for err is wrong since it is preinitialized and the code relies on it in case of an exception.
---
drivers/s390/char/vmwatchdog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/char/vmwatchdog.c +2 -2
@@ -66,8 +66,8 @@ static int __diag288(enum vmwdt_func fun"0: la %0,0\n" "1:\n" EX_TABLE (0b ,1b ) - : "=d" (err) : "d"(__func), "d"(__timeout), - "d"(__cmdp), "d"(__cmdl), "0" (-EINVAL) : "1", "cc"); + : "+d" (err) : "d"(__func), "d"(__timeout), + "d"(__cmdp), "d"(__cmdl) : "1", "cc"); return err; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
Hi Martin.
Quoted 2 lines · Martin Schwidefsky
The current set of s390 patches ready to be pushed once 2.6.23 has hit the streets.
I noticed that I had not yet beautified the vmlinux.lds file of s390. Please consider the next two patches for 2.6.24.
The first patch refactor vmlinux.lds to a consistent (and more readable) style that is being gradually introduced for all archs. Rationale behind a consistent style is to make across-all-archs changes less error prone and to better recongnize similar patterns. The patch moves a few labels so they get the correct value even if ld decide to align the section a few bytes.
The second patch introduce use of PAGE_SIZE as replacemnt of the hardcoded value 4096 and convert a few decimal numbers to hex.
Sam
Quoted 15 lines · Sam Ravnborg
Hi Martin.
Quoted 2 lines · Martin Schwidefsky
The current set of s390 patches ready to be pushed once 2.6.23 has hit the streets.
I noticed that I had not yet beautified the
vmlinux.ldsfile of s390. Please consider the next two patches for 2.6.24.The first patch refactor
vmlinux.ldsto a consistent (and more readable) style that is being gradually introduced for all archs. Rationale behind a consistent style is to make across-all-archs changes less error prone and to better recongnize similar patterns. The patch moves a few labels so they get the correct value even if ld decide to align the section a few bytes.
Quoted 2 lines
The second patch introduce use of
PAGE_SIZEas replacemnt of the hardcoded value 4096 and convert a few decimal numbers to hex.
Patches look good, I'll add them to the repository.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 1/2 s390: beautify vmlinux.lds
In reply to Martin SchwidefskyIntroduce a consistent style in vmlinux.lds. This style is gradually being introduced for all archs.
A few lables were moved inside the section definition so they are assigned the correct value of gcc decide to align the content to another address than the one . has. In the past this has fixed several bugs but for s390 it will not impact due to all the alignmnet already introduced.
Stabs definitions are consolidated in asm-generic/vmlinux.lds.h This patch also introduce support for DWARF - without knowing if this makes sense for s390.
---
build tested only
vmlinux.lds.S | 233 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 127 insertions(+), 106 deletions(-)
arch/s390/kernel/vmlinux.lds.S +127 -106
@@ -18,121 +18,142 @@ jiffies = jiffies_64; SECTIONS { - . = 0x00000000; - _text = .; /* Text and read-only data */ - .text : { - *(.text.head) + . = 0x00000000; + .text : { + _text = .; /* Text and read-only data */ + *(.text.head) TEXT_TEXT - SCHED_TEXT - LOCK_TEXT - KPROBES_TEXT - *(.fixup) - *(.gnu.warning) + SCHED_TEXT + LOCK_TEXT + KPROBES_TEXT + *(.fixup) + *(.gnu.warning) } = 0x0700 - _etext = .; /* End of text section */ + _etext = .; /* End of text section */ - RODATA + RODATA #ifdef CONFIG_SHARED_KERNEL - . = ALIGN(1048576); /* VM shared segments are 1MB aligned */ + . = ALIGN(1048576); /* VM shared segments are 1MB aligned */ #endif - . = ALIGN(4096); - _eshared = .; /* End of shareable data */ - - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; - - NOTES - - BUG_TABLE - - .data : { /* Data */ - DATA_DATA - CONSTRUCTORS - } - - . = ALIGN(4096); - __nosave_begin = .; - .data_nosave : { *(.data.nosave) } - . = ALIGN(4096); - __nosave_end = .; - - . = ALIGN(4096); - .data.page_aligned : { *(.data.idt) } - - . = ALIGN(256); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } - - . = ALIGN(256); - .data.read_mostly : { *(.data.read_mostly) } - _edata = .; /* End of data section */ - - . = ALIGN(8192); /* init_task */ - .data.init_task : { *(.data.init_task) } - - /* will be freed after init */ - . = ALIGN(4096); /* Init code and data */ - __init_begin = .; - .init.text : { - _sinittext = .; - *(.init.text) - _einittext = .; - } - /* - * .exit.text is discarded at runtime, not link time, - * to deal with references from __bug_table - */ - .exit.text : { *(.exit.text) } - - .init.data : { *(.init.data) } - . = ALIGN(256); - __setup_start = .; - .init.setup : { *(.init.setup) } - __setup_end = .; - __initcall_start = .; - .initcall.init : { - INITCALLS - } - __initcall_end = .; - __con_initcall_start = .; - .con_initcall.init : { *(.con_initcall.init) } - __con_initcall_end = .; - SECURITY_INIT + . = ALIGN(4096); + _eshared = .; /* End of shareable data */ + + . = ALIGN(16); /* Exception table */ + __ex_table : { + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; + } + + NOTES + BUG_TABLE + + .data : { /* Data */ + DATA_DATA + CONSTRUCTORS + } + + . = ALIGN(4096); + .data_nosave : { + __nosave_begin = .; + *(.data.nosave) + } + . = ALIGN(4096); + __nosave_end = .; + + . = ALIGN(4096); + .data.page_aligned : { + *(.data.idt) + } + + . = ALIGN(256); + .data.cacheline_aligned : { + *(.data.cacheline_aligned) + } + + . = ALIGN(256); + .data.read_mostly : { + *(.data.read_mostly) + } + _edata = .; /* End of data section */ + + . = ALIGN(8192); /* init_task */ + .data.init_task : { + *(.data.init_task) + } + + /* will be freed after init */ + . = ALIGN(4096); /* Init code and data */ + __init_begin = .; + .init.text : { + _sinittext = .; + *(.init.text) + _einittext = .; + } + /* + * .exit.text is discarded at runtime, not link time, + * to deal with references from __bug_table + */ + .exit.text : { + *(.exit.text) + } + + .init.data : { + *(.init.data) + } + . = ALIGN(256); + .init.setup : { + __setup_start = .; + *(.init.setup) + __setup_end = .; + } + .initcall.init : { + __initcall_start = .; + INITCALLS + __initcall_end = .; + } + + .con_initcall.init : { + __con_initcall_start = .; + *(.con_initcall.init) + __con_initcall_end = .; + } + SECURITY_INIT #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(256); - __initramfs_start = .; - .init.ramfs : { *(.init.initramfs) } - . = ALIGN(2); - __initramfs_end = .; + . = ALIGN(256); + .init.ramfs : { + __initramfs_start = .; + *(.init.initramfs) + . = ALIGN(2); + __initramfs_end = .; + } #endif - PERCPU(4096) - . = ALIGN(4096); - __init_end = .; - /* freed after init ends here */ - - __bss_start = .; /* BSS */ - .bss : { *(.bss) } - . = ALIGN(2); - __bss_stop = .; - - _end = . ; - - /* Sections to be discarded */ - /DISCARD/ : { - *(.exit.data) *(.exitcall.exit) - } - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } + + PERCPU(4096) + . = ALIGN(4096); + __init_end = .; /* freed after init ends here */ + + /* BSS */ + .bss : { + __bss_start = .; + *(.bss) + . = ALIGN(2); + __bss_stop = .; + } + + _end = . ; + + /* Sections to be discarded */ + /DISCARD/ : { + *(.exit.data) + *(.exitcall.exit) + } + + /* Debugging sections. */ + STABS_DEBUG + DWARF_DEBUG }
PATCH 2/2 s390: use PAGE_SIZE in vmlinux.lds
In reply to Martin SchwidefskyRepalce the hardcoded 4096 value with the PAGE_SIZE macro. Converted a few decimal numbers to readable hex numbers.
Use of PAGE_SIZE required a small change to page.h to allow PAGE_SIZE to be used from assembler/linker scripts.
---
build tested only
arch/s390/kernel/vmlinux.lds.S | 27 ++++++++++++++------------- include/asm-s390/page.h | 3 ++- 2 files changed, 16 insertions(+), 14 deletions(-)
arch/s390/kernel/vmlinux.lds.S +14 -13
@@ -2,6 +2,7 @@ * Written by Martin Schwidefsky ([email protected]) */ +#include <asm/page.h> #include <asm-generic/vmlinux.lds.h> #ifndef CONFIG_64BIT
@@ -35,10 +36,10 @@ SECTIONS RODATA #ifdef CONFIG_SHARED_KERNEL - . = ALIGN(1048576); /* VM shared segments are 1MB aligned */ + . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */ #endif - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); _eshared = .; /* End of shareable data */ . = ALIGN(16); /* Exception table */
@@ -56,37 +57,37 @@ SECTIONS CONSTRUCTORS } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .data_nosave : { __nosave_begin = .; *(.data.nosave) } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_end = .; - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .data.page_aligned : { *(.data.idt) } - . = ALIGN(256); + . = ALIGN(0x100); .data.cacheline_aligned : { *(.data.cacheline_aligned) } - . = ALIGN(256); + . = ALIGN(0x100); .data.read_mostly : { *(.data.read_mostly) } _edata = .; /* End of data section */ - . = ALIGN(8192); /* init_task */ + . = ALIGN(2 * PAGE_SIZE); /* init_task */ .data.init_task : { *(.data.init_task) } /* will be freed after init */ - . = ALIGN(4096); /* Init code and data */ + . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .;
@@ -104,7 +105,7 @@ SECTIONS .init.data : { *(.init.data) } - . = ALIGN(256); + . = ALIGN(0x100); .init.setup : { __setup_start = .; *(.init.setup)
@@ -124,7 +125,7 @@ SECTIONS SECURITY_INIT #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(256); + . = ALIGN(0x100); .init.ramfs : { __initramfs_start = .; *(.init.initramfs)
@@ -133,8 +134,8 @@ SECTIONS } #endif - PERCPU(4096) - . = ALIGN(4096); + PERCPU(PAGE_SIZE) + . = ALIGN(PAGE_SIZE); __init_end = .; /* freed after init ends here */ /* BSS */
include/asm-s390/page.h +2 -1
@@ -9,11 +9,12 @@#ifndef _S390_PAGE_H#define _S390_PAGE_H +#include <linux/const.h> #include <asm/types.h> /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))#define PAGE_DEFAULT_ACC 0#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)