Re: [PATCH 18/31] swim: Remove redundant RELAX actions

Laurent Vivier <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k
Message-ID <[email protected]>
Le 16/07/2026 à 12:02, Finn Thain a écrit :
> Wherever we have a swim_select() or swim_readbit() call there is an
> implicit RELAX. That means the caller doesn't have to do it. Remove the
> redundant code.
> 
> BTW, Inside Macintosh says, "Be sure [...] that CA0 and CA1 are set high
> before changing SEL." Hence the RELAX found in swim_select(). The SwimIII
> driver in mkLinux also has that. But the swim3.c driver in Linux is odd:
> it scatters RELAX actions around as though SEL was not actually under its
> control... In anycase, swim.c really does control SEL so there's no need
> for that here.
> 
> Signed-off-by: Finn Thain <[email protected]>
> ---
>   drivers/block/swim.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
> 

Reviewed-by: Laurent Vivier <[email protected]>

> diff --git a/drivers/block/swim.c b/drivers/block/swim.c
> index 6f93ebaaffb7..b4bf96a788db 100644
> --- a/drivers/block/swim.c
> +++ b/drivers/block/swim.c
> @@ -336,7 +336,6 @@ static inline void swim_motor(struct swim __iomem *base,
>   		swim_action(base, MOTOR_ON);
>   
>   		for (i = 0; i < 2*HZ; i++) {
> -			swim_select(base, RELAX);
>   			if (swim_readbit(base, MOTOR_ON))
>   				break;
>   			set_current_state(TASK_INTERRUPTIBLE);
> @@ -344,7 +343,7 @@ static inline void swim_motor(struct swim __iomem *base,
>   		}
>   	} else if (action == OFF) {
>   		swim_action(base, MOTOR_OFF);
> -		swim_select(base, RELAX);
> +		swim_write(base, phase, RELAX);
>   	}
>   }
>   
> @@ -355,13 +354,11 @@ static inline void swim_eject(struct swim __iomem *base)
>   	swim_action(base, EJECT);
>   
>   	for (i = 0; i < 2*HZ; i++) {
> -		swim_select(base, RELAX);
>   		if (!swim_readbit(base, DISK_IN))
>   			break;
>   		set_current_state(TASK_INTERRUPTIBLE);
>   		schedule_timeout(1);
>   	}
> -	swim_select(base, RELAX);
>   }
>   
>   static inline void swim_head(struct swim __iomem *base, enum head head)
> @@ -385,7 +382,6 @@ static inline int swim_step(struct swim __iomem *base)
>   		set_current_state(TASK_INTERRUPTIBLE);
>   		schedule_timeout(1);
>   
> -		swim_select(base, RELAX);
>   		if (!swim_readbit(base, STEP))
>   			return 0;
>   	}
> @@ -399,8 +395,6 @@ static inline int swim_track00(struct swim __iomem *base)
>   	swim_action(base, SEEK_NEGATIVE);
>   
>   	for (try = 0; try < 100; try++) {
> -
> -		swim_select(base, RELAX);
>   		msleep(3);
>   
>   		if (swim_readbit(base, TRACK_ZERO))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.